Join Now
Home Aptitude Reasoning DI VA GK CA CA Hindi Quiz Placements
try
catch
finally
handle
myVariable
$variable
2variable
_variable
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;
public class Test { public static void main(String args[]) { String name = "Java"; System.out.println(name.substring(1, 3)); } }
Ja
av
Jav
No output
while
for
do-while
if
What is Java?
A programming language
An operating system
A database management system
A web browser
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
public class Test { public static void main(String args[]) { String name = "Java"; for(int i = 0; i < name.length(); i++) { System.out.print(name.charAt(i) + " "); } } }
J a v a
Java
Jv
public class Test { public static void main(String args[]) { int x = 5; int y = 2; System.out.println(x / y); } }
2
2.5
None of the above