Java Programming MCQ Questions with Answers

Java Programming MCQ Questions with Answers

Java Programming MCQ Questions with Answers for Interviews and helpful for various examinations BE, BTech, BCA, MCA.

Are you looking for Java Programming Multiple Choice Questions with Answers? If so, you have come to the right place!

Each question includes an answer explanation, which will help to further clarify any confusion or misunderstandings. Additionally, the article provides tips to help understand complex concepts and topics.

Java Programming MCQ

Java Programming MCQ with Answers

1. ___ is the ability of a Java application to perform multiple tasks at the same time.
A) Multiprogramming
B) Multithreading
C) Multiprocessing
D) Multitasking
Ans: B

2. Java is designed for the distributed environment of the Internet because it handles ___ protocols
Ans: B

3. Java is associated with ___ programming Language
A) Oak
B) Basic
C) C
D) Perl
Ans: A

4. Which Property does not hold good for Java.
A) Object-oriented
B) Secure
C) dynamic
D) Complex
Ans: D

5. A compiler converts the Java program into an intermediate language representation called ___
A) bytecode
B) byte
C) byteclass
D) bytejava
Ans: A

6. ___ Operator is used to creating an object.
A) class
B) new
C) print
D) main
Ans: B

7. Which of the following is NOT a Java Keyword?
A) Abstract
B) Native
C) Package
D) Synchronize
Ans: D

8. Java platform consists of JVM and a package of readymade software components this package is known as ___.
A) Java API
Ans: A

9. Which of the following is not a Looping statement ___
B) Switch
C) While
D) Do-While
Ans: B

10. ___ is a multi-way branch statement
A) Switch
B) Continue
C) Break
D) Label
Ans: A

11. Choose the proper operator precedence when evaluating an Expression?
1. Comparisons
2. Logical operations
3. Increment
4. Arithmetic operations

A) 1-2-4-3
B) 4-3-1-2
C) 2-1-4-3
D) 3-4-1-2
Ans: D

12. The ___ statement is used inside the switch to terminate a Statement sequence
A) break
B) Jump
C) exit
D) goto
Ans: A

13. A class that is inherited is called a superclass ___
A) superclass
B) Subclass
C) subsetclass
D) Relativeclass
Ans: A

14. An ___ determines which features of a class may be used by other classes
A) specifier
B) inheritance
C) implementation
D) Access specifier
Ans: D

15. Which property of Java allows the creation of hierarchical classifications?
A) Interface
B) Inheritance
C) Robust
D) Distributed
Ans: B

16. Which of the following method does not belong to the graphics class?
A. Text
B. pixel
C. Lines
D. Circle and ellipse.
Ans: B

17. The class at the top of the exception classes hierarchy is called ___
A) Common
B) Throwable.
D) Catch
Ans: B

18. Find the keyword which is not used to implement exception
A) try
B) catch
C) finally
D) access
Ans: D

19. Which of the following is not a Exception in Java.
A) Arithmetic Exception
B) Nullpointer Exception
C) ArrayoutofBounds Exception
D) Logical Exception
Ans: D

20. Which of the following Definitions hold good for Exception?
A) Abnormal event that occurs during program execution and disrupts the normal flow of Instruction.
B) The unexpected situations that may occur during program execution
C) The term exception denotes an exception event.
D) All the above
Ans: D

21. The ___ class creates and maintains a buffer for an input stream
A) Common BufferedInputStream
B) BufferedStream
C) InputStream
D) BufferedInputStream
Ans: D

22. A ___ is a sequence of bytes traveling from a source to a destination over a communication path.
A) string
B) stream
C) character
D) integer
Ans: B

23. Which of the following statement is the explanation of the int read () method
A) Reads a byte of data from the input stream
B) Reads bytes of data from the input stream and stores them in the array
C) Reads the number of bytes specified by the third argument from the input stream and stores.
D) Returns the number of bytes available for reading from the input stream
Ans: A

24. Which method is used to read a byte as an 8-bit signed value?
A) Boolean readbyte()
B) byte read()
C) readbyte()
D) byte readByte()
Ans: D

25. A ___ is a java program that can be embedded in a Web page
A) Applets
B) browser
C) package
D) None of these
Ans: A

26. A applet tag is written in the body tag of ___
D) Applet
Ans: C

27. All applets must be declared as ___.
A) Protected
B) Public
C) Private
D) Static
Ans: B

28.___ method is called the first time an applet is loaded into the memory of a computer
A) init method()
B) start method()
C) stop method()
D) destroy method()
Ans: A

29. ___ is a set of computer programs that controls the creation, maintenance, and the use of the database of an organization and its end-users
Ans: A

30. ___ provides a database-programming interface for Java programs
Ans: B

31. Which of the following is NOT a part of JDBC URL?
A) <protocol>
B) <subprotocol>
C) <subname>
D) <name>
Ans: D

32. ___ package Contains classes that help in connecting to a database
C) java.sql
D) java.MySQL
Ans: C

33. RMI stands for
A) Remote Method Invocation
B) Remote method invention
C) Remote Memory Interface
D) Reduced Method Instructions
Ans: A

34. CORBA stands for
A) Common Operation Request Broker Architecture
B) Common Object Request Bean Architecture
C) Common Object Request Broker Architecture
D) Component Object Request Broker Architecture
Ans: C

35. The ___ method takes a Graphics class object as a parameter. The ___ method draws the graphics of the applet in the drawing area.
A) Paint (), update ()
B) repaint(),Paint()
C) update () , paint ()
D) Paint(),repaint()
Ans: C

36. ___ is a Technology used in java programming for objects interacting on different platforms across a network.
A) Java IDL
B) Java OMG
C) Java TCP
D) Java ORB
Ans: A

37. Servlets provide an efficient replacement for ___ scripts
Ans: A

38. ___ contains the class libraries that are needed to create servlets
Ans: B

39. Choose the CORRECT statement.
A) To write JSP code you require a browser.
B) To test the JSPs you need a server engine.
C) JSPs looks like HTML script
D) JSP combines HTML and JDK tools
Ans: C

40. The ___ is used to handle the errors that may occur during the invocation of a remote method. Remote Method Invocation uses ___ Protocol
A) Interface, TCP
B) Exception, TCP
C) Exception, UDP
D) Interface, UDP
Ans: B

MCQ questions for class 10 information technology

41. ___ is a highly optimized set of instructions designed to be executed by the Java runtime system, which is called the ___.
A) Bytecode, Java Virtual Machine
B) Data Code, Java machine
C) Source code, Microsystems
D) Bytecode, Microsystems.
Ans: A

42. Which of the following are not java buzzwords?
1. Simple
2. Servlets
3. Portable
4. Object-oriented
5. Applets
6. Multithreaded

A) 4 and 6 only
B) 1and 3 only
C) 5 and 6 only
D) 2 and 5 only
Ans: D

43. Two kinds of data types in java are ___ and ___
A) Primitive, standard
B) Primitive, Abstract
C) abstract, derived
D) Constants, variables
Ans: B

44. Which of the following is not a java data type?
1. Byte
2. Register
3. Long
4. Nibble
5. Int
6. Char

A) 4 and 5 only
B) 1and 3 only
C) 5 and 6 only
D) 2 and 4 only
Ans: D

45. The ___ keyword is used to derive a class from a superclass. The ___ keyword is used to declare classes that define common properties and behavior of other classes
A) Public, friend
B) abstract, extends,
C) Extends, abstract
D) Friend, Public
Ans: C

46. A class can be declared as ___ if you do not want the class to be subclassed. Using the ___ keyword we can abstract a class interface from its implementation
A) Protected, interface
B) Final, interface
C) Public, friend
D) Final, protected
Ans: B

47. The term exception denotes an ___ event. Java handles exceptions the ___ way.
A) Exceptional, object-oriented
B) Traditional, object-oriented
C) Exceptional, procedural
D) Friend, Public
Ans: A

48. Identify the situations in which a null exception is NOT thrown
1. Using an object without allocating memory for it.
2. Calling the methods of a null object.
3. Accessing or modifying the attributes of a null object.
4. Attempt to access an array element beyond the index of the array

A) 1
B) 3
C) 4
D) 2
Ans: C

49. The two major classes for byte streams are ___ and ___
A) Input, Output.
B) byteStream, bitStream.
C) InputStream, OutputStream.
D) stringStream, stingStream.
Ans: C

50. The ___ and ___ classes are filter streams that allow the reading and Writing of Java primitive data types.
A) InputStream, OutputStream
B) DataInputStream, DataOutputStream
C) Input, Output.
D) byteStream, bitStream.
Ans: B

Core Java Multiple Choice Questions with Answers


Java programming is an essential skill to have in today’s digital world. This article provided multiple choice questions with answers to help you get a better understanding of the language and its components.

By taking the time to understand and practice Java coding, you can create powerful applications for many different platforms and use cases. As technology continues to evolve, having a solid foundation in Java will allow you to stay one step ahead of the competition.

Thanks for reading the post on Java Programming MCQ Questions with Answers, if you like please share on social media.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top