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. How to compile java code in command prompt?

javac filename.java
java filename.java
javac filename
java filename

2. When does Exceptions in Java arises in code sequence?

Run Time
Can Occur Any Time
Compilation Time
None of the mentioned

3. Which of the following for loop declaration is not valid?

for ( int i = 99; i >= 0; i / 9 )
for ( int i = 7; i <= 77; i += 7 )
for ( int i = 20; i >= 2; - -i )
for ( int i = 2; i <= 20; i = 2* i )

4. In java, how many streams are created for us automatically?

2
3
4
5

5. What will be the output of the program?

  
class increment {
        public static void main(String args[]) 
        {      
             int g = 4;
             System.out.print(++g * 8);
        }
}
	

32
36
40
48

6. JDBC Driver manager loads a database-specific driver in an application to establish a connection with a database.

Yes
No
Can be yes or no
Can not say

7. Predict the output of following Java Program?

  
class Test {
	public static void main(String args[]) {
	 int x = -4;
	 System.out.println(x>>1);
	 int y = 4;
	 System.out.println(y>>1);
	}
}

Compiler Error: Operator >> cannot be applied to negative numbers
-2
2
2
2
2

8. Which of these access specifiers can be used for an interface?

Public
private
Protected
All of the mentioned

9. Which of these class is related to all the exceptions that can be caught by using catch?

Error
Exception
RuntimeExecption
All of the mentioned

10. After first public release java was targeted at ______________________.

Internet development
Search Engine Development
Desktop Development
Operating System Development

Results