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. Character data type cannot store following value.

Digit
Letter
Special Character
String

2. What is the output of this program?

  
class ternary_operator
{
	public static void main(String args[])
	{
		int x = 3;
		int y = ~ x;
		int z;
		z = x > y ? x : y;
		System.out.print(z);
	}
}

0
1
3
-4

3. Which methods to print output with formatted numbers?

printf()
format()
formatted()
Both A and B

4. Java Array can allocate __________.

Dynamic Memory
Static Memory
Both A and B
None of the above

5. paint() is an abstract method defined in AWT.

TRUE
FALSE
Can be true or false
Can not say

6. Which of these keywords must be used to monitor for exceptions?

finally
throw
catch
try

7. Which of the following personality is called as father of Java Programming language -

James Gosling
Larry Page
Bjarne Stroustrup
None of these

8. What is/are highest order precedence operator(s) in Java?

( )
{ }
Both A & B
None of these

9. What is -Xms and -Xmx while starting jvm?

Initial; Maximum memory
Initial memory
Maximum memory
Maximum; Initial memory

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