Question#1 Who originally created the Java programming language? a) Bjarne Stroustrup at AT&T b) Dennis Ritchie at Bell Labs c) Guido van Rossum at CWI d) James Gosling at Sun Microsystems ✅- Answer Question#2 What is a major advantage of Java's platform independence? a) Java code can run on any system with a JVM ✅- Answer b) Java runs only on Linux systems c) Java needs recompilation for different platforms d) Java code can only run on Oracle hardware Question#3 What is the purpose of the Java Virtual Machine (JVM)? a) To convert Java into C++ code b) To provide an environment to execute Java bytecode ✅- Answer c) To manage computer hardware resources d) To compile Java source code to machine code Question#4 Which feature allows Java programs to be run on many types of architectures without modification? a) Platform-specific executables b) Manual recompilation for each platform c) Direct conversion to machine code d) Platform independence through bytecode and JVM ✅- Answer Question#5 How does Java achieve object-oriented programming? a) By prohibiting the use of classes b) By treating everything as an object ✅- Answer c) By restricting access to objects d) By using only procedural code Question#6 Which functionality does an Integrated Development Environment (IDE) provide for Java? a) Translates Java directly to binary b) Allows writing and debugging Java code ✅- Answer c) Only updates Java libraries d) Only provides hardware support Question#7 What is encapsulation in Java's object-oriented programming? a) Taking on multiple forms b) Wrapping code and data together in a single unit ✅- Answer c) Inheriting properties from parent classes d) Hiding methods from other classes Question#8 Which Java feature allows running multiple threads simultaneously within a program? a) Static typing b) Synchronous execution c) Multithreading ✅- Answer d) Single tasking Question#9 In Java, what does the 'public' keyword specify for a class or method? a) It can be modified only once b) The class or method is accessible from other packages ✅- Answer c) It is private to the current file only d) The code will execute first Question#10 What is the entry point for a standard Java application? a) The start() block b) The execute(command) function c) The main method: public static void main(String[] args) ✅- Answer d) The init method Question#11 What kind of program does not run in a graphical environment but in a command-line interface? a) Console program ✅- Answer b) Web application c) Mobile application d) Desktop application Question#12 Which data type in Java represents a single Unicode character? a) short b) char ✅- Answer c) double d) byte Question#13 What is an interface in Java? a) A collection of abstract methods for classes to implement ✅- Answer b) A GUI window manager c) A data structure for storing arrays d) A concrete class with implementation Question#14 Which operator in Java is used to check if two values are equal? a) += b) <= c) != d) == ✅- Answer Question#15 What is the role of garbage collection in Java? a) Automatic memory management ✅- Answer b) Reducing CPU usage c) Manual resource cleanup d) Optimizing network calls Question#16 What does the 'final' value of primitive type 'int' represent in Java? a) A method signature b) A floating-point constant c) A specific fixed integer value ✅- Answer d) An array of bytes Question#17 Which Java feature supports building distributed applications? a) Exclusive use of local variables b) Limited network access c) Manual message passing only d) Support for distributed objects using RMI and EJB ✅- Answer Question#18 What is the primary purpose of abstraction in OOP? a) Restricting memory usage b) Hiding implementation details and showing functionality only ✅- Answer c) Enforcing variable visibility d) Increasing code duplication Question#19 Which operator in Java is used for bitwise AND operation? a) ~ b) ^ c) | d) & ✅- Answer Question#20 How is method polymorphism achieved in Java? a) Using only static variables b) Through method overriding and overloading ✅- Answer c) Allowing direct memory access d) Enforcing single inheritance