Java MCQ

Java MCQ

  • Admin
  • 30th Apr, 2022

Java MCQ Questions

Following are mostly asked Java MCQ test that are designed for professionals like you to crack you interviews. You can take this Java online test before appearing to you real interview. This Java quiz there are around 30+ multiple choice questions on Java with four options.

1) What is JAVA?

  • A. scripting language
  • B. programming language
  • C. markup language
  • D. All of the above

2) ___ is known as the father of Java.

  • A. James Gosling
  • B. Rasmus Lerdrof
  • C. Denis Richie
  • D. None of the above

3) Java was developed by Sun Microsystems in the year __.

  • A. 1995
  • B. 1996
  • C. 1998
  • D. 1999

4) What are the features of JAVA?

  • A. Platform independent
  • B. Secured
  • C. Object Oriented
  • D. All of the above

5) What are the listed concept of OOPs?

  • A. Inheritance
  • B. Abstraction
  • C. Polymorphism
  • D. Encapsulation
  • E. All of the above
Download Free : Java MCQ PDF

6) JDK stands for ___ which is a software development environment which is used to develop Java applications and applets.

  • A. Java Development Kit
  • B. Java Device Kit
  • C. Jar Development Kit
  • D. None of the above

7) Which are the various primitive types in JAVA?

  • A. char data type
  • B. boolean data type
  • C. byte data type
  • D. short data type
  • E. All of the above

8) Which of the following represent ternary operator in JAVA?

  • A. ? :
  • B. ||
  • C. &&
  • D. All of the above

9) Which of the following for loop declaration is not valid?

  • A. for ( int i = 99; i >= 0; i / 9 )
  • B. for ( int i = 7; i <= 77; i += 7 )
  • C. for ( int i = 20; i >= 2; - -i )
  • D. for ( int i = 2; i <= 20; i = 2* i )

10) Which package contains the Random class?

  • A. java.util package
  • B. java.lang package
  • C. java.awt package
  • D. java.io package

11) What do you mean by nameless objects?

  • A. An object created by using the new keyword.
  • B. An object of a superclass created in the subclass.
  • C. An object without having any name but having a reference.
  • D. An object that has no reference.

12) What do you mean by chained exceptions in Java?

  • A. Exceptions occurred by the VirtualMachineError.
  • B. An exception caused by other exceptions.
  • C. Exceptions occur in chains with discarding the debugging information.
  • D. None of the above

13) In which memory a String is stored, when we create a string using new operator?

  • A. Stack
  • B. Heap memory
  • C. Random storage space
  • D. String memory

14) What is the use of the intern() method?

  • A. It returns the existing string from memory.
  • B. It creates a new string in the database.
  • C. It modifies the existing string in the database.
  • D. None of the above

15) Which of the following is a reserved keyword in Java?

  • A. object
  • B. strictfp
  • C. main
  • D. system

16) Which keyword is used for accessing the features of a package?

  • A. package
  • B. import
  • C. extends
  • D. export

17) JAR stands for ___ in JAVA.

  • A. Java ARchive
  • B. Java Application Resource
  • C. Java Application Runner
  • D. None of the above

18) Which of the following is a mutable class in java?

  • A. java.lang.String
  • B. java.lang.StringBuilder
  • C. java.lang.Byte
  • D. java.lang.Short

19) What is the default encoding for an OutputStreamWriter?

  • A. UTF-8
  • B. Default encoding of the host platform
  • C. UTF-12
  • D. None of the above

20) Which of this keyword must be used to inherit a class?

  • A. super
  • B. this
  • C. extent
  • D. extends

21) Java was originally named:

  • A. Coffee
  • B. Duke
  • C. New C++
  • D. Oak

22) What was Java originally designed for?

  • A. Cars
  • B. Internet
  • C. Gaming
  • D. Interactive TV

23) Which company owns Java?

  • A. Microsoft
  • B. Google
  • C. Oracle
  • D. Intel

24) Which is the important Concept in the following in Java?

  • A. Java Virtual Machine
  • B. Compiler
  • C. Interpreter
  • D. All of the above

25) Is Android based on Java?

  • A. True
  • B. False

26) _________________ is a collection of elements used to store the same type of data.

  • A. Array
  • B. Loop
  • C. Switch
  • D. Case

27) Which of the following statements outputs the fifth value in the quizzes array?

  • A. quizzes[5];
  • B. quizzes[4];
  • C. System.out.println(quizzes[5]);
  • D. System.out.println(quizzes[4]);

28) Java is a

  • A. Structure Oriented Language
  • B. Machine Language
  • C. Procedure Oriented Language
  • D. Object_Oriented Language

29) In Java WORA stands for

  • A. Write Once Run Anywhere
  • B. Write Once Return Anywhere
  • C. Write Once Read Anywhere
  • D. Write Once Recall Anywhere

30) Main() method is not mandatory for a Java program

  • A. True
  • B. False

Java Online Test Questions (Java FAQs)

1) What is Compiler?

A compiler is a program that translates code written in a high-level language into machine code.

2) What is the machine language of the Java Virtual Machine?

The machine language of Java Virtual Machine is Bytecode.

3) What are Java applets?

Java applets are Java applications that run within a web browser. They are mainly used for internet programming. the applet is capable of performing many tasks on a web page, such as displaying graphics, playing sounds and accepting user input.

Leave A Comment :

Valid name is required.

Valid name is required.

Valid email id is required.

Related MCQ/Quiz

Devops  Mcq