I have two programs and both program execute but i can't see results(it flashs and disapears )
Am i missing something?Is my JBuiler working correctly?
Here is code both programs
Please help me
Program 1
class Foo
{
public int x = 10;
public static int y = 10;
};
public class Q5
{
public static void main (String [] args)
{
Foo a = new Foo ();
Foo b = new Foo ();
Foo c = new Foo ();
a.x = 5;
b.x = a.x * 20;
c.y = 75;
a.y = c.y / 3;
c.x = 30;
System.out.println ("a.x = " + a.x);
System.out.println ("a.y = " + a.y);
System.out.println ("b.x = " + b.x);
System.out.println ("b.y = " + b.y);
System.out.println ("c.x = " + c.x);
System.out.println ("c.y = " + c.y);
}
}
Program 2
public class Edu1 {
public static void main(String[] args) {
String line = null;
System.out.print("Please enter your name: "
try {
// get user input from console
BufferedReader reader = new BufferedReader
(new InputStreamReader(System.in));
line = reader.readLine ();
}
catch (Exception e) {
e.printStackTrace ();
System.exit(1);
}
System.out.println("\nHello " + line);
}
}
Am i missing something?Is my JBuiler working correctly?
Here is code both programs
Please help me
Program 1
class Foo
{
public int x = 10;
public static int y = 10;
};
public class Q5
{
public static void main (String [] args)
{
Foo a = new Foo ();
Foo b = new Foo ();
Foo c = new Foo ();
a.x = 5;
b.x = a.x * 20;
c.y = 75;
a.y = c.y / 3;
c.x = 30;
System.out.println ("a.x = " + a.x);
System.out.println ("a.y = " + a.y);
System.out.println ("b.x = " + b.x);
System.out.println ("b.y = " + b.y);
System.out.println ("c.x = " + c.x);
System.out.println ("c.y = " + c.y);
}
}
Program 2
public class Edu1 {
public static void main(String[] args) {
String line = null;
System.out.print("Please enter your name: "
try {
// get user input from console
BufferedReader reader = new BufferedReader
(new InputStreamReader(System.in));
line = reader.readLine ();
}
catch (Exception e) {
e.printStackTrace ();
System.exit(1);
}
System.out.println("\nHello " + line);
}
}