Java MCQ Quiz Hub

Java Multiple Choice Questions.

Choose a topic to test your knowledge and improve your Java skills

Java programs are





✅ Correct Answer: 2

Java has its origin in





✅ Correct Answer: 4

Which one of the following is true for Java





✅ Correct Answer: 1

The command javac is used to





✅ Correct Answer: 2

Java servlets are an efficient and powerful solution for creating ………….. for the web. D)





✅ Correct Answer: 1

Filters were officially introduced in the Servlet ……………… specification.





✅ Correct Answer: 2

Which is the root class of all AWT events





✅ Correct Answer: 2

OOP features are i) Increasing productivity ii) Reusability iii) Decreasing maintenance cost iv) High vulnerability





✅ Correct Answer: 2

break statement is used to i) get out of method ii) end a program iii) get out of a loop iv) get out of the system





✅ Correct Answer: 4

Native-protocol pure Java converts ……….. into the ………… used by DBMSs directly.





✅ Correct Answer: 1

All Java classes are derived from





✅ Correct Answer: 3

The jdb is used to





✅ Correct Answer: 2

What would happen if “String[]args” is not included as an argument in the main method?





✅ Correct Answer: 3

For the execution of DELETE SQL query in JDBC, …………. method must be used.





✅ Correct Answer: 3

Which method will a web browser call on a new applet?





✅ Correct Answer: 4

Which of the following is not mandatory in a variable declaration?





✅ Correct Answer: 3

When a programming class implements an interface, it must provide behavior for





✅ Correct Answer: 4

In order to run JSP ……………….. is required.





✅ Correct Answer: 3

State true or false. i) AWT is an extended version of swing ii) Paint( ) of Applet class cannot be overridden





✅ Correct Answer: 1

Prepared Statement object in JDBC used to execute……….. queries.





✅ Correct Answer: 4

In Java variables, if first increment of the variable takes place and then the assignment occurs. This operation is also called…………………………





✅ Correct Answer: 1

When the operators are having the same priority, they are evaluated from …………….. …………. in the order they appear in the expression.





✅ Correct Answer: 2

In Java, …………. can only test for equality, whereas ………… can evaluate any type of Boolean expression.





✅ Correct Answer: 1

The ………………….. looks only for a match between the value of the expression and one of its case constants.





✅ Correct Answer: 3

System.in.read() is being used, the program must specify the ……………… clause.





✅ Correct Answer: 3

By using ………………. you can force immediate termination of a loop, bypassing the conditional expression and any remaining code in the body of the loop.





✅ Correct Answer: 1

The out object is an object encapsulated inside the …………….. class and represents the standard output device.





✅ Correct Answer: 3

The third type of comment is used by a tool called ……………… for automatic generation of documentation.





✅ Correct Answer: 3

In the second type, the information written in java after // is ignored by the …………………..





✅ Correct Answer: 2

The compiled Java program can run on any ………………… platform having Java Virtual Machine (JVM) installed on it. A) program B) java C) hardware D) nonjava





✅ Correct Answer: 3

JSP embeds in ……………. in ………………….





✅ Correct Answer: 4

State true or false. i) init() is called after start() in applet ii) applets are used for networking iii) inheritance is a part of Java Foundation Classes iv) final does not prevent inheritance





✅ Correct Answer: 2