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. What is the output of this program?

  
class selection_statements
{
	public static void main(String args[])
	{
		int var1 = 5;
		int var2 = 6;
		if ((var2 = 1) == var1)
			System.out.print(var2);
		else
			System.out.print(++var2);
	}
}

1
2
3
4

2. Default, public , protected, private are?

Access Modifier
Non-access Modifiers
Both A and B
It's variable

3. Which of these statements are incorrect?

Assignment operators can be used only with numeric and character data type
Assignment operators are more efficiently implemented by Java run-time system than their equivalent long forms
Assignment operators run faster than their equivalent long forms
None of the mentioned

4. What is the output of this program?

class Main
{
public static void main(String[] args)
  {
   try
   {
    return;
   }
   finally
   {
    System.out.println( "Finally" );
   }
  }
}

Finally
Compilation fails
The code runs with no output
An exception is thrown at runtime

5. Which annotation is used to represent command line input and assigned to correct data type?

@Input
@Variable
@Command Line
@Parameter

6. Java SE 15 version released on?

March 19, 2019
March 17, 2020
September 17, 2019
September 15, 2020

7. Which of the following classes directly implement Set interface?

Vector
HashSet
HashTable
LinkedList

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

TRUE
FALSE
Can be true or false
Can not say

9. Which of the following methods is a method of wrapper Integer for obtaining hash code for the invoking object?

Integer hashcode()
int hashcode()
int hashCode()
int hash()

10. Which of these class is related to all the exceptions that cannot be caught?

Error
Exception
RuntimeExecption
All of the mentioned

Results