MCQs on Introduction to Java | Java Programming Fundamentals

Introduction to Java

Overview of Java Programming

  1. What is Java primarily used for?
    • A. Web development
    • B. Mobile applications
    • C. Embedded systems
    • D. All of the above
  2. Which of the following is NOT a key feature of Java?
    • A. Object-oriented
    • B. Platform-dependent
    • C. Portable
    • D. Multithreaded
  3. Java is best described as which of the following types of programming language?
    • A. High-level, interpreted, and object-oriented
    • B. Low-level and compiled
    • C. High-level and interpreted
    • D. Low-level and procedural
  4. Which of the following is an essential feature of Java that allows it to be platform-independent?
    • A. Java bytecode
    • B. Compiled machine code
    • C. Assembly language
    • D. Object-oriented principles
  5. What does JVM stand for in Java?
    • A. Java Variable Machine
    • B. Java Version Manager
    • C. Java Virtual Machine
    • D. Java View Manager
  6. Which statement is true about the Java compiler?
    • A. It compiles Java source code directly into machine code
    • B. It converts Java source code into Java bytecode
    • C. It compiles Java source code into HTML
    • D. It directly interprets Java code

History of Java

  1. Who developed Java?
    • A. Microsoft
    • B. Sun Microsystems
    • C. Oracle Corporation
    • D. IBM
  2. In which year was Java officially released?
    • A. 1995
    • B. 1989
    • C. 2001
    • D. 1999
  3. What was the original name of Java before it was changed?
    • A. Oak
    • B. River
    • C. Pine
    • D. Redwood
  4. Who was the lead architect of Java when it was first created?
    • A. Bill Gates
    • B. Mark Zuckerberg
    • C. James Gosling
    • D. Larry Page
  5. Which company acquired Sun Microsystems, the original developer of Java?
    • A. IBM
    • B. Oracle Corporation
    • C. Microsoft
    • D. Apple
  6. What was the first version of Java called?
    • A. Java 1.0
    • B. Java 2
    • C. JDK 1.0
    • D. JDK 1.1

Java Language Features

  1. Which of the following is NOT a feature of Java?
    • A. Platform independence
    • B. Multithreading support
    • C. Static typing
    • D. Low-level memory management
  2. Which concept in Java allows you to write code that can be used on multiple platforms?
    • A. Virtual Machine
    • B. Platform independence
    • C. Encapsulation
    • D. Inheritance
  3. What type of programming does Java use for organizing and managing large software projects?
    • A. Functional programming
    • B. Object-oriented programming
    • C. Procedural programming
    • D. Assembly programming
  4. Which feature of Java allows multiple threads to run concurrently within a program?
    • A. Multithreading
    • B. Parallel processing
    • C. Single-threaded execution
    • D. Asynchronous programming
  5. Which feature in Java allows access control for data and methods in classes?
    • A. Encapsulation
    • B. Polymorphism
    • C. Abstraction
    • D. Inheritance
  6. What does the Java garbage collector do?
    • A. Collects the output of the program
    • B. Collects unused variables and releases memory
    • C. Collects input from the user
    • D. Collects errors during compilation
  7. Which of the following is an example of polymorphism in Java?
    • A. A class can inherit from another class
    • B. A method can have multiple definitions based on the type of object
    • C. A variable can store both string and integer values
    • D. A method can be overloaded
  8. What is the role of constructors in Java?
    • A. They initialize objects when they are created
    • B. They destroy objects when they are no longer needed
    • C. They convert data types
    • D. They create the class itself
  9. What does inheritance allow in Java?
    • A. A class to inherit methods and properties from another class
    • B. A class to hide its data
    • C. A class to destroy its objects
    • D. A class to run independently
  10. Which of the following is NOT an access modifier in Java?
    • A. public
    • B. private
    • C. protected
    • D. static

Java Development Environment (JDK, JRE)

  1. Which of the following is the correct full form of JDK?
    • A. Java Development Kit
    • B. Java Deployment Kit
    • C. Java Design Kit
    • D. Java Data Kit
  2. Which of the following components is NOT part of the JDK?
    • A. Java compiler
    • B. Java Virtual Machine (JVM)
    • C. Java runtime environment (JRE)
    • D. Java Debugger
  3. What is the purpose of JRE in Java?
    • A. To provide the tools necessary to compile Java code
    • B. To provide the libraries and Java Virtual Machine required to run Java programs
    • C. To debug Java code
    • D. To deploy Java applications
  4. Which of the following is a primary function of the JVM?
    • A. Compiling Java source code into bytecode
    • B. Running Java bytecode on the machine
    • C. Installing Java packages
    • D. Debugging Java programs
  5. What is the difference between JDK and JRE?
    • A. JDK contains tools for development, while JRE is for running Java programs
    • B. JDK is a runtime environment, while JRE is for developers
    • C. JDK is used for debugging, while JRE is used for compiling
    • D. There is no difference
  6. Which of the following is included in the Java Runtime Environment (JRE)?
    • A. Compiler
    • B. JVM and libraries
    • C. Development tools
    • D. Debugger
  7. How does Java achieve portability across different operating systems?
    • A. Through the use of machine-dependent code
    • B. Through the use of Java bytecode and the JVM
    • C. By compiling Java code into native code
    • D. By using specific OS-dependent libraries
  8. What is the function of the Java debugger (jdb)?
    • A. It compiles Java programs
    • B. It simulates the execution of Java programs
    • C. It helps track and troubleshoot errors in Java code
    • D. It checks for syntax errors during compilation

Answers Table

QnoAnswer (Option with the text)
1D. All of the above
2B. Platform-dependent
3A. High-level, interpreted, and object-oriented
4A. Java bytecode
5C. Java Virtual Machine
6B. It converts Java source code into Java bytecode
7B. Sun Microsystems
8A. 1995
9A. Oak
10C. James Gosling
11B. Oracle Corporation
12A. Java 1.0
13D. Low-level memory management
14B. Platform independence
15B. Object-oriented programming
16A. Multithreading
17A. Encapsulation
18B. Collects unused variables and releases memory
19B. A method can have multiple definitions based on the type of object
20A. They initialize objects when they are created
21A. A class to inherit methods and properties from another class
22D. static
23A. Java Development Kit
24C. Java runtime environment (JRE)
25B. To provide the libraries and Java Virtual Machine required to run Java programs
26B. Running Java bytecode on the machine
27A. JDK contains tools for development, while JRE is for running Java programs
28B. JVM and libraries
29B. Through the use of Java bytecode and the JVM
30C. It helps track and troubleshoot errors in Java code

Use a Blank Sheet, Note your Answers and Finally tally with our answer at last. Give Yourself Score.

X
error: Content is protected !!
Scroll to Top