You can always press Enter⏎ to continue
Java Quiz
1
Instructions For Quiz
This Mock Test has 20 Questions
Each Question is of 1 marks so total 20 marks
Multiple Choice Questions(MCQ) with only ONE valid answer
Previous
Next
Submit
Press
Enter
2
1) Which class can access all public and protected methods and fields of its super class?
*
This field is required.
Inner class
outer class
sub-class
Super class
Previous
Next
Submit
Press
Enter
3
2) Method,Field can be accessed from the same class to which they belong.
*
This field is required.
Public
Protected
Default
Private
Previous
Next
Submit
Press
Enter
4
3) In java, float takes _________ bytes in memory.
*
This field is required.
8
4
2
16
Previous
Next
Submit
Press
Enter
5
4) What will be the output of following piece of code?
*
This field is required.
public class operatorExample { public static void main(String args[]) { int x=4; System.out.println(x++); } }
output=0
output=6
output=5
output=4
Previous
Next
Submit
Press
Enter
6
5) Can variables be used in Java without initialization?
*
This field is required.
No
Yes
Previous
Next
Submit
Press
Enter
7
6) Can a class in java be inherited from more than one class?
*
This field is required.
Yes
No
Previous
Next
Submit
Press
Enter
8
7) What will be the output of Round(3.7).
*
This field is required.
4
3.7
3
0
Previous
Next
Submit
Press
Enter
9
8) Does Java supports goto?
*
This field is required.
No
Yes
Previous
Next
Submit
Press
Enter
10
9) In JAVA can a dead thread be started again?
*
This field is required.
Yes
No
Previous
Next
Submit
Press
Enter
11
10) Is JDK required on each machine to run a Java program?
*
This field is required.
Yes
No
Previous
Next
Submit
Press
Enter
12
11) Which tool is required on each machine to run a Java program?
*
This field is required.
JDK
SDK
JRE
CVS
Previous
Next
Submit
Press
Enter
13
12) Is it possible to define a method in Java class but provide it’s implementation in the code of another language like C?
*
This field is required.
No
Yes
Previous
Next
Submit
Press
Enter
14
13) Can a variable be local and static at the same time?
*
This field is required.
No
Yes
Previous
Next
Submit
Press
Enter
15
14) Can we have any other return type than void for main method in java class?
*
This field is required.
Yes
No
Previous
Next
Submit
Press
Enter
16
15) Which method of the Runnable interface that must be implemented by all threads?
*
This field is required.
Run()
Start()
Sleep()
Wait()
Previous
Next
Submit
Press
Enter
17
16) Which Keyword is used If a class has multiple constructors defined,it's possible to call a constructor from another constructor’s body?
*
This field is required.
super()
constant()
this()
Previous
Next
Submit
Press
Enter
18
17) Can we compare string and stringBuffer in Java?
*
This field is required.
Yes
No
Previous
Next
Submit
Press
Enter
19
18) Can we cast any other type to boolean type with type casting?
*
This field is required.
Yes
No
Previous
Next
Submit
Press
Enter
20
19) Base class for all exceptions
*
This field is required.
Java.throwable
Java.Lang.throwable
Java.Lang.Exception
Java.Lang.throwables
Previous
Next
Submit
Press
Enter
21
20) Environment variable that stores the location of bin folder
*
This field is required.
PATH
CLASSPATH
PATHS
BIN
Previous
Next
Submit
Press
Enter
Should be Empty:
Question Label
1
of
21
See All
Go Back
Submit