Programming MCQs

Solved MCQ on Java set-4

Pinterest LinkedIn Tumblr

Here are the collections of solved MCQ on Java includes multiple-choice questions on fundamentals of java programming language. It includes solved MCQ questions on java variables and operators, Java Virtual Machine (JVM), and the type of Boolean expression.

1. In Java variables, if the first increment of the variable takes place and then the assignment occurs. This operation is also called …………………………
A) pre-increment
B) post-increment
C) incrementation
D) pre incrementation

2. When the operators are having the same priority, they are evaluated from ……………..  …………. in the order they appear in the expression.
A) right to left
B) left to right
C) any of the order
D) depends on the compiler

3. In java,  …………. can only test for equality, whereas ………… can evaluate any type of Boolean expression.
A) switch, if
B) if, switch
C) if, break
D) continue, if

4. The ………………….. looks only for a match between the value of the expression and one of its case constants.
A) if
B) match
C) switch
D) None of the above

5. System.in.read() is being used, the program must specify the ……………… clause.
A) throws.java.out.IOException
B) throws.java.in.IOException
C) throws.java.io.IOException
D) throws.java.io.InException

Read Also: Java Multiple Choice Questions With Answers

6. By using ………………. you can force immediate termination of a loop, bypassing the conditional expression and any remaining code in the body of the loop.
A) Break
B) Continue
C) Terminate
D) Loop Close

7. The out object is an object encapsulated inside the …………….. class and represents the standard output device.
A) standard
B) local
C) global
D) system

8. The third type of comment is used by a tool called ……………… for automatic generation of documentation.
A) Java commenting
B) Java generator
C) Java doc
D) Java loc

9. In the second type, the information written in java after // is ignored by the …………………..
A) Interpreter
B) Compiler
C) Programmer
D) All of the above

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

Answers:

1.  A) pre-increment
2.  B) left to right
3.  A) switch, if
4.  C) switch
5.  C) throws.java.io.IOException
6.  A) Break
7.  D) system
8.  C) Java doc
9.  B) Compiler
10.C) hardware

Read Next: Java Quitz Questions and Answers set-5

Author

Shuseel Baral is a web programmer and the founder of InfoTechSite has over 8 years of experience in software development, internet, SEO, blogging and marketing digital products and services is passionate about exceeding your expectations.

Comments are closed.