Join Now
Home Aptitude Reasoning DI VA GK CA CA Hindi Quiz Placements
var
let
int
def
myVariable
$variable
2variable
_variable
boolean
double
string
What is the output of the following code?
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
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[]) { String name = "Java"; System.out.println(name.substring(1, 3)); } }
Ja
av
Jav
No output
int[] numbers = {1, 2, 3};
int numbers[] = {1, 2, 3};
int numbers = {1, 2, 3};
Both A and B
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[]) { System.out.println("Hello" + " World"); }
Hello
World
Hello World
HelloWorld