Hello Diploma Students in this article we have provided 22412 Java Programming Mcq Questions with Answers. In this Java Programming Objective Type Questions and Answers We have Selected 30 Important Questions from Previous Year Papers and Made A possible Set Of Questions which can Help Students in Preparation for Their Exams.

This Java Programming Mcq Pdf with Answers Is Ideal for Candidates who are in 2nd Year of Diploma in Computer Engineering By Referring this Java Programming Mcq Question Bank Diploma in Computer Engineering Students Can Practice for their Upcoming Exams. We Have Also Provided java programming mcq pdf Link at the end of the Quiz You can Download it for Future Reference.

For More Java Mock Test Questions (Start Test)

22412 Java Programming Mcq Questions with Answers

1) Which constraint must be considered at the time of variable declaration? 
A] It should not be keyword
B] It must not begin with digit
C] White space not allowed
D] All of above

Correct!

Wrong!

2) The comparisons can be done with the help of ____________ operator. 
A] Relational
B] Mathematical
C] Arithmetic
D] Assignment

Correct!

Wrong!

3) Which of the following is not an assignment operator? 
A] +=
B] = =
C] %=
D] =

Correct!

Wrong!

4)  _____________ _ operator is used to construct conditional expressions. 
A] Dot(.)
B] instanceof
C] Ternary(?:)
D] None

Correct!

Wrong!

5) Which statement is used to terminate the loop early? 
A] terminate
B] continue
C] skip
D] break

Correct!

Wrong!

6) Which statement is used to skip the loop and continue with the next iteration? 
A] continue
B] terminate
C] skip
D] break

Correct!

Wrong!

7)  Which of the following classes in the Java.io package defines a method to delete a file. 
A) Stack
B) File
C) String
D) Vector

Correct!

Wrong!

8) For a valid file object reference, we can create a new file using the following classes defined in the Java.io package. i) FileOutputStream ii) RandomAccessFile iii) DataInput
A) i and ii only
B) ii and iii only
C) i and iii only
D) All i, ii and iii

Correct!

Wrong!

9) The Date class includes within ………………….. package.
A) java.io
B) java.awt
C) java.net
D) java.util

Correct!

Wrong!

10) Which of the following classes are included in the java.awt package. i) Font ii) Frame iii) Float iv) File
A) i and ii only
B) ii and iii only
C) iii and iv only
D) i and iv only

Correct!

Wrong!

11) Which of the following sub-classes are included in object class in Java. i) Dictionary ii) Date iii) Label iv) Thread 
A) i, ii and iii only
B) ii, iii and iv only
C) i, iii and iv only
D) i, ii and iv only

Correct!

Wrong!

12)  An …………………. is an incomplete class that requires further specification. 
A) abstract class
B) final class
C) static class
D) super class

Correct!

Wrong!

13) The ……………………. statement is passed a single parameter, which is a reference to the exception object thrown. 
A) throw
B) catch
C) finally
D) try

Correct!

Wrong!

14)  Every try statement should be followed by at least one catch statement; otherwise …………………. will occur. 
A) no execution
B) null
C) zero
D) compilation error

Correct!

Wrong!

15) If an exception occurs within the …………………….. block, the appropriate exception-handler that is associated with the try block handles the exception. 
A) throw
B) catch
C) finally
D) try

Correct!

Wrong!

16) Exception classes are available in the ……………………package.
A) java.lang
B) java.awt
C) java.io
D) java.applet

Correct!

Wrong!

17)  …………………….. is caused by general I/O failures, such as inability to read from file.
A) I/O failure
B) I/O exception
C) I/O inability
D) I/O distortion

Correct!

Wrong!

18) Which of the following methods are not included in the OutputStream class. 
A) write( )
B) skip( )
C) close( )
D) flush( )

Correct!

Wrong!

19) The class DataInputStream extends …………………….. and implements the interface DataInput.
A) FileInputStream
B) SequenceInputStream
C) FilterInputStream
D) InputStream

Correct!

Wrong!

20)  The method …………………., force writes whenever the data accumulates in the output stream.
A) write( )
B) flush( )
C) read( )
D) reset( )

Correct!

Wrong!

21) The DataInputStream and DataOutputStream classes are …………………….. streams that allow the reading and writing of Java primitive data types.
A) file
B) sequence
C) object
D) filter

Correct!

Wrong!

22)  The ……………………… class provides the capacity to read primitive data types from an input stream. 
A) pushbackInputStream
B) DataInputStream
C) BufferedInputStream
D) PipeInputStream

Correct!

Wrong!

23) DataInput is 
A) an abstract class defined in java.io
B) a class we can use to read primitive data types
C) an interface that defines methods to open files
D) an interface that defines methods to read primitives data types

Correct!

Wrong!

24) Which exception is thrown by the read( ) method of InputStream class. 
A) Exception
B) IOException
C) ReadException

Correct!

Wrong!

25) Java uses a keyword ………………… to preface a block of code that is likely to cause an error condition and ‘throw’ an exception. 
A) throw
B) catch
C) finally
D) try

Correct!

Wrong!

26) When an exception in a try block is generated, Java treats the multiple ………………. statements like cases in switch statements. 
A) throw
B) catch
C) finally
D) try

Correct!

Wrong!

27) An …………………. is an incomplete class that requires further specification. 
A) abstract class
B) final class
C) static class
D) super class

Correct!

Wrong!

28) A class can be declared as ………………………. if you do not want the class to be subclassed. 
A) abstract
B) final
C) static
D) super

Correct!

Wrong!

29) Java __________________. 
a) Only compiles
b) Only interprets
c) Compiles and then interprets
d) Interprets & then compile

Correct!

Wrong!

30) JVM stands for __________________ 
a) Java Virtual Method
b) Java Virtual Machine
c)Java Variable & Methods
d) Java Versatile Machine

Correct!

Wrong!

Share the quiz to show your results !

Subscribe to see your results

22412 2

I got %%score%% of %%total%% right

%%description%%

%%description%%

Loading…

Java Programming Objective Type Questions and Answers

Mcq on Java Programming Pdf (Download)

Students Also Search for:

First Year Basic Science MCQ (View Here)

For Free Mock Test (View Here)

Msbte News Social accounts

We provide regular updates about msbte on our social accounts For latest msbte diploma updates you can follow our page on Instagram @msbtenews and Facebook @msbtediplomaupdates. we solve your queries by message on our social accounts so do follow our social accounts if you have any queries related to diploma and engineering courses. 

Thankyou for Visiting Msbte News.

Msbte News is created to help msbte diploma students to find study resources, which are very much needed for diploma students while preparing for the exam. msbtenews.com provide polytechnic solved question papers which are provided by msbte.org.in. with these msbte polytechnic model answer paper students gets a rough idea about paper pattern and marks distribution.

LEAVE A REPLY

Please enter your comment!
Please enter your name here