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 of these operators can be used to get run time information about an object?

getInfo
Info
instanceof
getinfoof

2. Predict the output of following Java Program?

class Main
{
 public static void main(String args[])
	{
		char array_variable [] = new char[10];
		for (int i = 0; i < 10; ++i)
		{
			array_variable[i] = 'i';
			System.out.print(array_variable[i] + " ");
		}
	}	
}

1 2 3 4 5 6 7 8 9 10
0 1 2 3 4 5 6 7 8 9 10
i j k l m n o p q r
i i i i i i i i i i

3. Decrement operator, −−, decreases the value of variable by what number?

1
2
3
4

4. Which of the following is used to interpret and execute Java Applet Classes hosted by HTML.

appletviewer
appletwatcher
appletshow
appletscreen

5. Which statement is true?

Programs will not run out of memory.
Objects that are referred to by other objects will never be garbage collected.
Objects that will never again be used are eligible for garbage collection.
Objects that can be reached from a live thread will never be garbage collected.

6. What will be the output of the program?

int x, y;
x=15; y=20;
if (x>15)
if(y>15)
{
	system.ptintln("y is "+y);
}
else
	system.out.ptintln("x is "+x);

Error
y is 20
x is 15
No output

7. Evaluate the value of the expression?

  
		   6 - 2 + 10 % 4 + 7
		   

14
12
13
10

8. To declare more than one variable of the specified type, we can use a __________ list.

colon-separated
bracket-separated
comma-separated
None of the above

9. Which statement is true?

catch(X x) can catch subclasses of X where X is a subclass of Exception.
Any statement that can throw an Exception must be enclosed in a try block.
The Error class is a RuntimeException.
Any statement that can throw an Error must be enclosed in a try block.

10. Can we perform file handling in Java by Java I/O API?

TRUE
FALSE
Can be true or false
Can not say

Results