Java Programming Quiz


Play this Java quiz that will help you to excel in Java certification exams, placements etc. This Java programming quiz consist of 10 questions that you need to solve in 10 minutes. We’ve specially designed this quiz so that you can quickly acquaint to the pattern of questions you can be asked in placement drives, certification exams etc. This Java programming test enables you to assess your knowledge of Java programming.

Take the Free Practice Test



Java MCQs

Practice Java MCQ Questions, which will help you to understand Java programming related concepts and also helps you to prepare for placements, technical rounds, interviews, competitive exams etc.

Java Quiz

Try Free Java Quiz, to start a quiz you need to login first, after login you will get start quiz button and then by clicking on that you can start quiz. You will get 10 Minutes to answer all questions.

Java Quiz

1. Which statement is true?

All objects that are eligible for garbage collection will be garbage collected by the garbage collector.
Objects from a class with the finalize() method overridden will never be garbage collected.
Objects with at least one reference will never be garbage collected.
Objects instantiated within anonymous inner classes are placed in the garbage collectible heap.

2. A __________ statement allows us to execute a statement or group of statements multiple times.

array
loop
function
exception

3. Java was designed by _________________.

Microsoft
Mozilla Corporation
Sun Microsystems
Amazon Inc.

4. All methods must be implemented of an interface.

TRUE
FALSE
Can be true or false
can not say

5. which of these will create and start this thread?

  
public class MyRunnable implements Runnable
{
	public void run()
	{
		// some code here
	}
}

new Runnable(MyRunnable).start();
new Thread(MyRunnable).run();
new Thread(new MyRunnable()).start();
new MyRunnable().start();

6. Which of these is a process of converting a simple data type into a class?

type casting
type conversion
type wrapping
None of the Mentioned

7. Index in array start with ______.

-1
0
1
infinite

8. What is the order of precedence (highest to lowest) of following operators?
1. &
2. ^
3. ?:

1 -> 2 -> 3
2 -> 1 -> 3
3 -> 2 -> 1
2 -> 3 -> 1

9. All Java components require names. Names used for classes, variables, and methods are called?

Variables
identifiers
Access Modifiers
Java Modifiers

10. After line 11 runs, how many objects are eligible for garbage collection?

  
class X2
{
	public X2 x;
	public static void main(String [] args)
	{
		X2 x2 = new X2(); /* Line 6 */
		X2 x3 = new X2(); /* Line 7 */
		x2.x = x3;
		x3.x = x2;
		x2 = new X2();
		x3 = x2; /* Line 11 */
		doComplexStuff();
	}
}

0
1
2
3

Results