Join Now
Home Aptitude Reasoning DI VA GK CA CA Hindi Quiz Placements
What is the output of the following code?
public class Test { public static void main(String args[]) { int x = 10; int y = 5; System.out.println(x > y); } }
1
0
MyClass object = new MyClass();
MyClass object = MyClass();
MyClass object;
MyClass object = null;
What is the output of the following program?
public class Test {public static void main(String args[]) {int x = 10;int y = x++;System.out.println(y); }}
10
11
9
None of the above
public class Test { public static void main(String args[]) { int x = 10; int y = 5; if(x > y) { System.out.println("x is greater than y"); } else { System.out.println("x is less than or equal to y"); } } }
x is greater than y
x is less than or equal to y
Both statements are printed
No output
public class Test { public static void main(String args[]) { String name = "Java"; System.out.println(name.substring(1, 3)); } }
Ja
av
Jav
public class Test { public static void main(String args[]) { for(int i = 0; i < 5; i++) { System.out.println(i); } } }
0 1 2 3 4
1 2 3 4 5
0 1 2 3 4 5
Infinite loop
public
private
protected
static
Implementing the Runnable interface
Extending the Thread class
Calling the start() method on a Thread object
Creating a new instance of the Thread class
int
boolean
double
string
public class Test { public static void main(String args[]) { int x = 10; int y = 20; System.out.println(x < y && x > 5); } }