Question#1 Java was created in the mid-1990s by _____ at Sun Microsystems. a) Bjarne Stroustrup b) Dennis Ritchie c) James Gosling ✅- Answer d) Ken Thompson Question#2 The _____ allows Java programs to run on any platform with the appropriate software installed. a) Java Runtime Environment (JRE) b) Java Development Kit (JDK) c) Java Virtual Machine (JVM) ✅- Answer d) Integrated Development Environment (IDE) Question#3 In Java, the source code is first compiled into platform-independent _____ before execution. a) assembly b) object file c) bytecode ✅- Answer d) machine code Question#4 The feature of Java that allows developers to 'write once, run anywhere' is known as _____. a) platform independence ✅- Answer b) encapsulation c) dynamic loading d) inheritance Question#5 Programs in Java can be written and debugged using an IDE, such as Eclipse, IntelliJ IDEA, or _____. a) NetBeans ✅- Answer b) Visual Studio c) Xcode d) PyCharm Question#6 Java supports multiple forms of behavior for an object, a concept known as _____. a) polymorphism ✅- Answer b) abstraction c) encapsulation d) inheritance Question#7 The principle of combining data and methods into a single unit in Java is called _____. a) encapsulation ✅- Answer b) inheritance c) abstraction d) modularity Question#8 A Java program’s execution starts from the _____ method. a) start b) main ✅- Answer c) init d) run Question#9 The smallest integer data type in Java is _____. a) long b) short c) byte ✅- Answer d) int Question#10 Java’s _____ ensures automatic memory management through garbage collection. a) API b) JVM ✅- Answer c) JDK d) Compiler Question#11 Classes in Java are blueprints for creating _____. a) methods b) variables c) objects ✅- Answer d) generics Question#12 A collection of elements of the same data type in Java stored in contiguous memory is called an _____. a) enum b) object c) array ✅- Answer d) interface Question#13 To define a contract of methods a class must implement, Java uses _____. a) generics b) superclasses c) constructors d) interfaces ✅- Answer Question#14 The operator used for logical AND operations in Java is _____. a) && ✅- Answer b) || c) & d) ^ Question#15 Java primitive data type used to represent true/false values is _____. a) char b) byte c) boolean ✅- Answer d) int Question#16 The built-in method to print output to the console in Java is _____. a) write() b) PrintWriter.print() c) System.out.println() ✅- Answer d) Console.log() Question#17 In Java, the '%' operator is used for _____. a) modulus (remainder) ✅- Answer b) exponentiation c) bitwise and d) division Question#18 The 'public' keyword before a class or method in Java specifies an _____. a) annotation b) operator c) access modifier ✅- Answer d) exception handler Question#19 Java supports _____, allowing programs to execute multiple threads concurrently. a) multiprocessing b) multiuser c) multithreading ✅- Answer d) multidimensionality Question#20 To specify a floating-point number in Java, the literal must end with the letter _____ for a float. a) l b) d c) f ✅- Answer d) b