Worksheetsjava base 1
Total questions: 16
Worksheet time: 11mins
Which component is used to compile, debug and execute the java programs?
JRE
JIT
JDK
JVM
Which of these cannot be used for a variable name in Java?
identifier & keyword
identifier
keyword
none of the mentioned
Which of the following is not an OOPS concept in Java?
Polymorphism
Compilation
Inheritance
Encapsulation
Which of these are selection statements in Java?
break
continue
for()
if()
What is the value stored in x in following lines of code?
int x, y, z;
x = 0;
y = 1;
x = y = z = 8;
1
9
8
0
Which of the following for loop declaration is not valid?
for ( int i = 99; i >= 0; i / 9 )
for ( int i = 7; i <= 77; i += 7 )
for ( int i = 20; i >= 2; - -i )
for ( int i = 2; i <= 20; i = 2* i )
What does JVM stands for?
Java Variable Machine
Java Virtual Machine
Java Virtual Mechanism
None of the above
What is JVM ?
JVM is the confined memory area
All java programs run inside JVM memory
JVM provides security to the computer by giving controlled access to Files and Memory on a computer
All the above
Which of the following is incorrect?
int count = 50.0;
int salary = 50_000;
int salary = 50_00;
all of these are incorrect
Where does a java program start executing instructions from:
class
source file
main method
object
What will be the output of the program?
ok
ok dokey
dokey
No output is produced
What will be the output of the program?
0
7
8
14
What will be the output of the program?
small
huge
tiny
Compilation fails
What is the numerical range of a char?
-128 to 127
-(215) to (215) - 1
0 to 32767
0 to 65535
What will be the output of the program?
9 7 7 foo 7 7foo
72 34 34 foo34 34foo
9 7 7 foo34 34foo
72 7 34 foo34 7foo
