Java/Java Multiple Choice Questions. Sample Test,Sample questions

Question:
 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

1.1 & 2

2.1,2 & 3

3.1 & 3

4.3

Posted Date:-2022-04-16 13:33:44


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

1.Interpreter

2.Compiler

3.Programmer

4.All of the above

Posted Date:-2022-04-16 16:29:06


Question:
 Java has its origin in

1.C programming language

2.PERRL

3.COBOL

4.Oak programming language

Posted Date:-2022-04-16 13:26:18


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

1.Executable

2.Simple

3.High level

4.Parameterized

Posted Date:-2022-04-16 16:05:12


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

1.if

2.match

3.switch

4.None of the above

Posted Date:-2022-04-16 16:23:36


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

1.main method

2.destroy method

3.execute method

4.init method

Posted Date:-2022-04-16 15:55:25


Question:
All Java classes are derived from

1. java.lang.Class

2.java.util.Name

3.java.lang.Object

4.java.awt.Window

Posted Date:-2022-04-16 15:49:54


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

1.Break

2.Continue

3.Terminate

4.Loop Close

Posted Date:-2022-04-16 16:25:43


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

1.2.1

2.2.3

3.2.2

4.2.4

Posted Date:-2022-04-16 13:30:55


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

1.executeQuery()

2.executeDeleteQuery()

3.executeUpdate()

4.executeDelete()

Posted Date:-2022-04-16 15:53:50


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

1.pre-increment

2.post-increment

3.incrementation

4.pre incrementation

Posted Date:-2022-04-16 16:06:46


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

1.switch, if

2.if, switch

3.if, break

4.continue, if

Posted Date:-2022-04-16 16:17:39


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

1.Mail Server

2.Applet viewer

3.Java Web Server

4.Database connection

Posted Date:-2022-04-16 16:02:47


Question:
Java programs are

1.Faster than others

2.Platform independent

3.Not reusable

4.Not scalable

Posted Date:-2022-04-16 13:25:23


Question:
Java servlets are an efficient and powerful solution for creating ………….. for the web.

D) 

1.Dynamic content

2.Static content

3.Hardware

4.Both a and b

Posted Date:-2022-04-16 13:29:49


Question:
JSP embeds in ……………. in ………………….

1.Servlet, HTML

2.HTML, Java

3.HTML, Servlet

4.Java, HTML

Posted Date:-2022-04-16 17:49:52


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

1.JDBC calls, network protocol

2. ODBC class, network protocol

3.ODBC class, user call

4.JDBC calls, user call

Posted Date:-2022-04-16 13:34:42


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

1. 1,2 & 4

2.1,2 & 3

3.1, 2 & 4

4.None of the above

Posted Date:-2022-04-16 13:32:54


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

1.i-false, ii-false B)C)

2.i-false,ii-true

3.i-true, ii-false

4.i-true, ii-true

Posted Date:-2022-04-16 16:04:22


Question:
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

1.i-true, ii-true, iii-false, iv-true

2.i-false, ii-false, iii-false, iv-false

3.i-true, ii-true, iii-true, iv-true

4. i-true, ii-false, iii-false, iv-false

Posted Date:-2022-04-16 17:51:40


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

1.throws.java.out.IOException

2.throws.java.in.IOException

3.throws.java.io.IOException

4.throws.java.io.InException

Posted Date:-2022-04-16 16:24:41


Question:
The command javac is used to

1.debug a java program

2.compile a java program

3.interpret a java program

4. execute a java program

Posted Date:-2022-04-16 13:28:39


Question:
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

1. program

2. java

3.hardware

4.nonjava

Posted Date:-2022-04-16 16:31:17


Question:
The jdb is used to

1.Create a jar archive

2.Debug a java program

3.Create a C header file

4.Generate java documentation

Posted Date:-2022-04-16 15:51:17


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

1.standard

2.local

3.global

4.system

Posted Date:-2022-04-16 16:26:49


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

1.Java commenting

2.Java generator

3.Java doc

4.Java loc

Posted Date:-2022-04-16 16:27:58


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

1.No error

2.Compilation error

3.The program won’t run

4.Program exit

Posted Date:-2022-04-16 15:52:44


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

1.two methods defined in that interface

2.any methods in a class

3.only certain methods in that interface

4.all methods defined in that interface

Posted Date:-2022-04-16 16:00:57


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

1.right to left

2.left to right

3.any of the order

4.depends on the compiler

Posted Date:-2022-04-16 16:12:24


Question:
Which is the root class of all AWT events

1.java.awt.ActionEvent

2.java.awt.AWTEvent

3. java.awt.event.AWTEvent

4.java.awt.event.Event

Posted Date:-2022-04-16 13:31:56


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

1.a semicolon

2.an identifier

3.an assignment

4.a data type

Posted Date:-2022-04-16 15:57:06


Question:
Which one of the following is true for Java

1.Java is object-oriented and interpreted

2.Java is efficient and faster than C

3.Java is the choice of everyone.

4.Java is not robust.

Posted Date:-2022-04-16 13:27:33


More MCQS

  1. Java Mcq Question Set 1
  2. Java Mcq Question Set 2
  3. Java Mcq Question Set 3
  4. Java Mcq Question Set 4
  5. Java Mcq Question Set 5
  6. Java Mcq Question Set 6
  7. Java Mcq Question Set 7
  8. Java Mcq Question Set 8
  9. Java Mcq Question Set 9
  10. Java Multiple Choice Questions
  11. DATA TYPES IN JAVA
  12. Classes ,Constructor ,Methods,Inheritance
  13. Java Multiple Choice Questions.
Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!