Join Now
Home Aptitude Reasoning DI VA GK CA CA Hindi Quiz Placements
Single
Multiple
Hierarchical
Hybrid
int
boolean
double
string
What is the output of the following code?
public class Test { public static void main(String args[]) { int x = 5; System.out.println(x++); } }
4
5
6
7
public class Test { public static void main(String args[]) { int x = 10; if(x > 5 && x < 15) { System.out.println("x is between 5 and 15"); } else { System.out.println("x is not between 5 and 15"); } } }
x is between 5 and 15
x is not between 5 and 15
5 and 15
No output
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 x = 5;
int 5 = x;
x = 5;
int x;
public
private
protected
static
public class Test { public static void main(String args[]) { int x = 10; int y = 5; int z = x + y; System.out.println("The sum of " + x + " and " + y + " is " + z); } }
The sum of 10 and 5 is 15
The sum of x and y is z
The sum of x and y is 15
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
class
new
object
create