Java MCQ Questions with Answers SET-2

Hey Guys welcome to CES Study247

This page provide you Java programming Multiple Choice Question Answer that is very useful for Semester , DRDO, ISRO ,Banking , Railway, Gate and another exam.

Q.21 In Java, the System class is defined in which package?

  • A) java.util package
  • B) java.io package
  • C) java.lang package
  • D) None of these

Q.22 Which of the following is NOT a feature of the Java programming language?

  • A) Use of pointers
  • B) Dynamic
  • C) Object-oriented
  • D) None of these

Q.23 In Java, the Scanner class is defined in which package?

  • A) java.util package
  • B) java.lang package
  • C) java.io package
  • D) None of these

Q.24 A variable that is declared inside a method is known as a?

  • A) Static variable
  • B) Local variable
  • C) Instance variable
  • D) None of these

Q.25 What is the primary reason for Java's portability and security?

  • A) Bytecode
  • B) Dynamic
  • C) Exception handling
  • D) None of these

Q.26 Which of the following is NOT an access modifier in Java?

  • A) Void
  • B) Public
  • C) Private
  • D) None of these

Q.27 In Java, the Scanner class is primarily used to take user input at?

  • A) Run-time
  • B) Compile time
  • C) Both A & B
  • D) None of these

Q.28 Which standard stream is used in Java for receiving input?

  • A) System.in
  • B) System.out
  • C) Both A & B
  • D) None of these

Q.29 Which standard stream is used in Java for sending output?

  • A) System.in
  • B) System.out
  • C) Both A & B
  • D) None of these

Q.30 Which keyword is used to access the features (classes/interfaces) of another package?

  • A) package
  • B) Scanner
  • C) import
  • D) None of these

Q.31 Which Scanner class method is specifically used to read an integer value from the user?

  • A) next()
  • B) nextInt()
  • C) readInt()
  • D) None of these

Q.32 How many primary categories of data types exist in Java?

  • A) 1
  • B) 2
  • C) 3
  • D) None of these

Q.33 Which of the following is NOT a core Object-Oriented Programming (OOP) concept?

  • A) Inheritance
  • B) Encapsulation
  • C) Polymorphism
  • D) Compilation

Q.34 The process that focuses only on the essential characteristics of an object while hiding details is:

  • A) Encapsulation
  • B) Polymorphism
  • C) Abstraction
  • D) Inheritance

Q.35 In object-oriented programming, 'Composition' refers to:

  • A) The use of consistent coding conventions
  • B) Coherent, common behavior within objects
  • C) Procedural behavior
  • D) None of these

Q.36 Which of the following is generally NOT considered a modern integrated development environment (IDE)?

  • A) NetBeans
  • B) Borland’s JBuilder
  • C) MS J++
  • D) Symantec Visual Cafe

Q.37 Which of the following is an incorrect name for a Java identifier (variable)?

  • A) xyz
  • B) 2nd name
  • C) xy2z
  • D) xyz2

Q.38 The Java compiler (javac) translates source code (.java) into which format?

  • A) Assembly language
  • B) Bytecode
  • C) Bit code
  • D) Machine code

Q.39 In the context of 'Polymorphism', the Greek word 'poly' means?

  • A) One
  • B) Many
  • C) Two
  • D) None of these

Q.40 In which year was the first conceptual version/implementation of the JVM introduced?

  • A) 1998
  • B) 1976
  • C) 1994
  • D) None of these

Scroll to Top