This section contains carefully selected MCQs and Previous Year Questions with explanations to help students understand concepts and prepare effectively for examinations, interviews, and competitive tests.
Q: 1Programming language Java was developed by ____________.
Option A
Java is a high-level, general-purpose, object-oriented programming language designed to be portable, secure, and robust. It was developed at Sun Microsystems under the leadership of James Gosling and was initially called Oak.
Java major idea is “Write Once, Run Anywhere” (WORA), meaning Java source code is compiled into platform-independent bytecode, which can run on any system having a compatible JVM (Java Virtual Machine).
| Java Version | Year | Important Points |
|---|---|---|
| Java 1.0 | 1996 | Java 1.0 was the first public release of Java and established the core Java platform. |
| Java 1.1 | 1997 | Java 1.1 introduced important features such as inner classes, JDBC, RMI, and the event delegation model. |
| Java 1.2 | 1998 | Java 1.2 introduced the Java 2 Platform terminology and included the Collections Framework and major improvements to the GUI libraries. |
| Java 1.3 | 2000 | Java 1.3 introduced improvements to performance and the HotSpot JVM and added several enhancements to the Java platform. |
| Java 1.4 | 2002 | Java 1.4 introduced assertions, regular expressions, the logging API, and chained exceptions. |
| Java 5.0 | 2004 | Java 5.0 was a major language release that introduced generics, enhanced for loop, enumerations, annotations, autoboxing/unboxing, and varargs. |
| Java 6 | 2006 | Java 6 focused largely on performance, usability, monitoring, and library improvements and introduced features such as scripting support and improved web-service support. |
| Java 7 | 2011 | Java 7 introduced try-with-resources, the diamond operator (<>), strings in switch, binary literals, and underscores in numeric literals. |
| Java 8 | 2014 | Java 8 introduced major functional-programming features including lambda expressions, the Stream API, functional interfaces, method references, and default/static methods in interfaces. |
| Java 9 | 2017 | Java 9 introduced the Java Platform Module System (JPMS), commonly known as the module system. |
| Java 10 | 2018 | Java 10 introduced local variable type inference using var and continued the new six-month Java release cycle. |
| Java 11 (LTS) | 2018 | Java 11 was the first Long-Term Support (LTS) release under the modern release model and included several API and platform improvements. |
| Java 12 | 2019 | Java 12 continued the six-month release cycle and introduced several enhancements, including switch expressions as a preview feature. |
| Java 13 | 2019 | Java 13 continued improvements to the language and JVM and included text blocks as a preview feature. |
| Java 14 | 2020 | Java 14 made switch expressions a standard feature and introduced records as a preview feature. |
| Java 15 | 2020 | Java 15 made text blocks a standard feature and introduced sealed classes as a preview feature. |
| Java 16 | 2021 | Java 16 made records and pattern matching for instanceof standard features. |
| Java 17 (LTS) | 2021 | Java 17 was an LTS release and made sealed classes a standard feature. |
| Java 18 | 2022 | Java 18 introduced the simple web server and continued improvements to the Java language, libraries, and JVM. |
| Java 19 | 2022 | Java 19 introduced virtual threads as a preview feature and continued development of modern concurrency features. |
| Java 20 | 2023 | Java 20 continued the development of preview and incubator features, including further work on virtual threads and pattern matching. |
| Java 21 (LTS) | 2023 | Java 21 was an LTS release and made virtual threads and record patterns standard features, among other improvements. |
| Java 22 | 2024 | Java 22 continued the six-month release cycle and introduced further language, library, JVM, and developer-productivity improvements. |
| Java 23 | 2024 | Java 23 continued improvements to the Java platform and introduced further enhancements to language and runtime features. |
| Java 24 | 2025 | Java 24 introduced further language and platform enhancements, including continued development of features such as flexible constructor bodies and primitive patterns. |
| Java 25 (LTS) | 2025 | Java 25 was released in September 2025 and became an LTS release. It includes multiple language, library, security, performance, and JVM enhancements. |
Q: 2JRE stands for:
Option D
JRE stands for Java Runtime Environment. It provides the environment required to run Java applications on a computer.
The JRE mainly contains the JVM (Java Virtual Machine) along with the required Java class libraries and supporting files.
When a Java program is compiled, the Java compiler (javac) converts the source code into bytecode. The JVM inside the JRE executes this bytecode.

Q: 3Which of the following is not keyword or reserved word in Java?
Option B
In Java, keywords are reserved words that have predefined meanings in the language and cannot be used as identifiers, such as variable names or method names.
The word then is not a Java keyword because Java does not use then in its conditional statements. Instead, Java uses if followed by a condition in parentheses and a statement or block of code.
Java Keywords List:
abstract, assert, boolean, break, byte, case, catch, char, class, const, continue, default, do, double, else, enum, extends, final, finally, float, for, goto, if, implements, import, instanceof, int, interface, long, native, new, package, private, protected, public, return, short, static, strictfp, super, switch, synchronized, this, throw, throws, transient, try, void, volatile, while, _.
Note:
| Word | Description |
|---|---|
| goto | Reserved keyword but has no functionality in Java. |
| const | Reserved keyword but unused. Java uses final for constants. |
| strictfp | Reserved keyword but obsolete in modern Java because floating-point evaluation is now consistently strict. |
| true | Boolean literal. Not a keyword. |
| false | Boolean literal. Not a keyword. |
| null | Null literal. Not a keyword. |
Q: 4What is the output of the following code?
class Test
{
static
{
System.out.print("A");
}
public static void main(String[] args)
{
System.out.print("B");
}
}
Option B
In Java, a static initialization block is executed automatically when the class is initialized, before the main() method starts executing. Therefore, the statement inside the static block prints A first.
After the static block finishes, the main() method executes and prints B. Hence, the final output is AB.
Q: 5Which of the following is the most important feature that makes Java suitable for Internet applications?
Option C
Java is widely used for Internet and web-based applications because of several important features. One of the key requirements for Internet applications is that programs must run on different platforms without modification and support networked or distributed computing.
Java fulfills these requirements through its Portability, meaning compiled Java bytecode can run on any system with a Java Virtual Machine (JVM), and its ability to work in a Distributed environment, allowing objects and programs to communicate over networks.
Q: 6Which concept in Java makes it platform independent?
Option D
Java is known for its Platform Independence, which means that a Java program can be developed on one operating system and executed on another operating system without changing the original source code. This feature is commonly described by the phrase “Write Once, Run Anywhere” (WORA).
The main reason behind this feature is Java's use of bytecode and the JVM. When a Java program is compiled, the Java compiler (javac) converts the source code into platform-independent bytecode. This bytecode is then executed by a JVM available on the target operating system.
Q: 7What is the main role of Java Development Kit (JDK)?
Option D
The Java Development Kit (JDK) is a software development kit provided by Java to help programmers develop Java applications. It contains tools for writing, compiling, and running Java programs.
The JDK includes the Java Compiler (javac) to convert source code into bytecode, the Java Runtime Environment (JRE) to execute Java programs, and other development tools such as debuggers and documentation generators.
Q: 8Which of the following is a commonly used Object-Oriented Programming Language?
Option C
Java is a widely used Object-Oriented Programming (OOP) language that supports core OOP principles such as classes, objects, inheritance, polymorphism, abstraction, and encapsulation.
Q: 9Which component is used to compile, debug and execute the Java programs?
Option D
Java programs are first written as source code (.java), then compiled into bytecode (.class), and finally executed by the Java runtime environment.
The JDK (Java Development Kit) is the complete development package used for developing Java applications. It contains tools required to compile, debug, and run Java programs. For example, the javac compiler is provided by the JDK and converts Java source code into bytecode.
| Component | Description |
|---|---|
| JDK (Java Development Kit) | Used to develop Java programs. It includes the compiler, debugger, Java launcher, JRE, and other development tools. |
| JRE (Java Runtime Environment) | Provides the environment required to run Java programs. It includes the JVM and required runtime libraries. |
| JVM (Java Virtual Machine) | Executes Java bytecode and provides platform-independent execution of Java programs. |
| JIT (Just-In-Time Compiler) | Improves program performance by compiling frequently executed bytecode into native machine code at runtime. |
| javac (Java Compiler) | Compiles .java source code into .class bytecode. |
| java (Java Launcher) | Starts and executes a Java application by launching the JVM and calling the main() method. |
| jdb (Java Debugger) | Used to debug Java programs by examining and controlling program execution. |
Q: 10The Java source code is initially converted to a __________.
Option D
Java source code is written in a .java file using Java programming language syntax. Before the program can be executed, the Java compiler (javac) converts the source code into bytecode.
This bytecode is stored in a .class file. It is platform-independent, meaning the same bytecode can be executed on different operating systems through a compatible JVM (Java Virtual Machine).
Thank you so much for taking the time to read my Computer Science MCQs section carefully. Your support and interest mean a lot, and I truly appreciate you being part of this journey. Stay connected for more insights and updates! If you'd like to explore more tutorials and insights, check out my YouTube channel.
Don’t forget to subscribe and stay connected for future updates.