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?



  • java.util package


  • java.io package


  • java.lang package


  • None of these

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



  • Use of pointers


  • Dynamic


  • Object-oriented


  • None of these

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



  • java.util package


  • java.lang package


  • java.io package


  • None of these

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



  • Static variable


  • Local variable


  • Instance variable


  • None of these

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



  • Bytecode


  • Dynamic


  • Exception handling


  • None of these

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



  • Void


  • Public


  • Private


  • None of these

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



  • Run-time


  • Compile time


  • Both A & B


  • None of these

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



  • System.in


  • System.out


  • Both A & B


  • None of these

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



  • System.in


  • System.out


  • Both A & B


  • None of these

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



  • package


  • Scanner


  • import


  • None of these

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



  • next()


  • nextInt()


  • readInt()


  • None of these

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



  • 1


  • 2


  • 3


  • None of these

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



  • Inheritance


  • Encapsulation


  • Polymorphism


  • Compilation

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



  • Encapsulation


  • Polymorphism


  • Abstraction


  • Inheritance

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



  • The use of consistent coding conventions


  • Coherent, common behavior within objects


  • Procedural behavior


  • None of these

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



  • NetBeans


  • Borland's JBuilder


  • MS J++


  • Symantec Visual Cafe

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



  • xyz


  • 2nd name


  • xy2z


  • xyz2

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



  • Assembly language


  • Bytecode


  • Bit code


  • Machine code

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



  • One


  • Many


  • Two


  • None of these

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



  • 1998


  • 1976


  • 1994


  • None of these

Scroll to Top