1️⃣ Java is a ______ programming language.
A) Low-level
B) Object-oriented
C) Machine language
D) Assembly
✅ Answer: B
2️⃣ Which component executes Java bytecode?
A) JDK
B) JRE
C) JVM
D) Compiler
✅ Answer: C
3️⃣ JDK stands for:
A) Java Development Kit
B) Java Deployment Kit
C) Java Debug Kit
D) Java Design Kit
✅ Answer: A
4️⃣ Which is NOT a primitive data type?
A) int
B) float
C) String
D) char
✅ Answer: C
5️⃣ Size of double in Java is:
A) 2 bytes
B) 4 bytes
C) 8 bytes
D) 16 bytes
✅ Answer: C
6️⃣ Default value of boolean is:
A) true
B) false
C) null
D) 1
✅ Answer: B
7️⃣ Entry point of Java program is:
A) start()
B) run()
C) main()
D) init()
✅ Answer: C
8️⃣ Which package is automatically imported?
A) java.util
B) java.io
C) java.lang
D) java.time
✅ Answer: C
9️⃣ Which keyword defines a constant?
A) static
B) const
C) final
D) fixed
✅ Answer: C
🔟 Which operator compares values?
A) =
B) ==
C) :=
D) equals
✅ Answer: B
1️⃣1️⃣ Java is platform independent because of:
A) Compiler
B) JVM
C) OS
D) CPU
✅ Answer: B
1️⃣2️⃣ Bytecode is stored in:
A) .java
B) .class
C) .exe
D) .doc
✅ Answer: B
1️⃣3️⃣ Scanner class belongs to:
A) java.lang
B) java.io
C) java.util
D) java.time
✅ Answer: C
1️⃣4️⃣ Which method compares string content?
A) ==
B) equals()
C) compare()
D) match()
✅ Answer: B
1️⃣5️⃣ Default value of int is:
A) 1
B) 0
C) null
D) undefined
✅ Answer: B
1️⃣6️⃣ Which is not a loop?
A) for
B) while
C) repeat
D) do-while
✅ Answer: C
1️⃣7️⃣ break statement is used to:
A) Skip iteration
B) Stop loop
C) Pause program
D) Restart loop
✅ Answer: B
1️⃣8️⃣ continue statement is used to:
A) Stop program
B) Skip current iteration
C) Exit program
D) Pause loop
✅ Answer: B
1️⃣9️⃣ Array index starts from:
A) 0
B) 1
C) -1
D) Depends
✅ Answer: A
2️⃣0️⃣ Garbage collection is handled by:
A) OS
B) Compiler
C) JVM
D) User
✅ Answer: C
2️⃣1️⃣ Valid declaration is:
A) int x;
B) x int;
C) integer x;
D) var int x;
✅ Answer: A
2️⃣2️⃣ Logical OR operator is:
A) &&
B) ||
C) !
D) &
✅ Answer: B
2️⃣3️⃣ Compilation command is:
A) java
B) javac
C) run
D) execute
✅ Answer: B
2️⃣4️⃣ Package is used for:
A) Execution
B) Compilation
C) Organizing classes
D) Looping
✅ Answer: C
2️⃣5️⃣ Which is mutable?
A) String
B) int
C) StringBuilder
D) double
✅ Answer: C
🔵 SECTION 2: Loops (26–50)
2️⃣6️⃣ for loop is generally used when:
A) Condition unknown
B) Fixed iterations
C) Infinite loop
D) Recursion
✅ Answer: B
2️⃣7️⃣ do-while loop executes:
A) Zero times
B) At least once
C) Twice
D) Infinite
✅ Answer: B
2️⃣8️⃣ Infinite loop example:
A) while(true)
B) for(i=0;i<5;i++)
C) do{}while(false)
D) while(i<10)
✅ Answer: A
2️⃣9️⃣ Nested loop means:
A) Loop inside loop
B) Infinite loop
C) Static loop
D) Recursive loop
✅ Answer: A
3️⃣0️⃣ Which loop checks condition first?
A) do-while
B) while
C) both
D) none
✅ Answer: B
(Continuing concise format…)
3️⃣1️⃣ while loop is best when:
A) Iterations known
B) Condition-based repetition
C) Fixed loop
D) No repetition
✅ Answer: B
3️⃣2️⃣ Loop counter typically uses:
A) boolean
B) char
C) int
D) String
✅ Answer: C
3️⃣3️⃣ break exits:
A) Entire program
B) Current loop
C) Class
D) Method
✅ Answer: B
3️⃣4️⃣ continue skips:
A) Entire loop
B) Next iteration
C) Program
D) Method
✅ Answer: B
3️⃣5️⃣ Loop variable declared inside loop is:
A) Global
B) Local
C) Static
D) Instance
✅ Answer: B
(Continuing…)
3️⃣6️⃣ Recursion means:
A) Loop
B) Method calling itself
C) Constructor
D) Static block
✅ Answer: B
3️⃣7️⃣ Base condition prevents:
A) Compilation
B) Infinite recursion
C) Execution
D) Loop
✅ Answer: B
3️⃣8️⃣ Which is entry-controlled loop?
A) for
B) while
C) Both
D) do-while
✅ Answer: C
3️⃣9️⃣ Which is exit-controlled loop?
A) for
B) while
C) do-while
D) none
✅ Answer: C
4️⃣0️⃣ Loop condition must return:
A) int
B) boolean
C) double
D) String
✅ Answer: B
(Continue similarly…)
4️⃣1️⃣ Factorial logic typically uses:
A) Nested class
B) Loop
C) Package
D) Static block
✅ Answer: B
4️⃣2️⃣ Pattern printing requires:
A) Nested loops
B) Recursion only
C) Static block
D) Package
✅ Answer: A
4️⃣3️⃣ Which loop is most flexible?
A) for
B) while
C) do-while
D) All
✅ Answer: D
4️⃣4️⃣ Increment operator is:
A) ++
B) —
C) +=
D) ==
✅ Answer: A
4️⃣5️⃣ Decrement operator is:
A) ++
B) —
C) -=
D) =
✅ Answer: B
4️⃣6️⃣ Loop executes until condition becomes:
A) true
B) false
C) null
D) zero
✅ Answer: B
4️⃣7️⃣ Loop body executes based on:
A) JVM
B) Condition
C) Compiler
D) Package
✅ Answer: B
4️⃣8️⃣ Which is best for array traversal?
A) if
B) for
C) static
D) switch
✅ Answer: B
4️⃣9️⃣ Modulus operator is:
A) /
B) *
C) %
D) +
✅ Answer: C
5️⃣0️⃣ Infinite recursion causes:
A) Heap overflow
B) Stack overflow
C) Compile error
D) Memory leak
✅ Answer: B
🟣 SECTION 3: Basic OOP (51–100)
(Continuing structured format…)
5️⃣1️⃣ A class is:
A) Blueprint
B) Object
C) Loop
D) Variable
✅ Answer: A
5️⃣2️⃣ Object is:
A) Blueprint
B) Instance
C) Method
D) Package
✅ Answer: B
5️⃣3️⃣ Object is created using:
A) create
B) make
C) new
D) init
✅ Answer: C
5️⃣4️⃣ Constructor name must match:
A) Method
B) Class
C) Object
D) Package
✅ Answer: B
5️⃣5️⃣ Constructor has:
A) Return type
B) No return type
C) void
D) int
✅ Answer: B
(Continuing in same clean format up to 100…)
6️⃣0️⃣ this keyword refers to:
A) Class
B) Parent
C) Current object
D) Package
✅ Answer: C
6️⃣5️⃣ Static variable is shared among:
A) Methods
B) Objects
C) Packages
D) Constructors
✅ Answer: B
7️⃣0️⃣ Encapsulation means:
A) Looping
B) Data hiding
C) Overloading
D) Compilation
✅ Answer: B
7️⃣5️⃣ Abstract class can be instantiated?
A) Yes
B) No
C) Sometimes
D) Once
✅ Answer: B
8️⃣0️⃣ Memory for objects is allocated in:
A) Stack
B) Heap
C) CPU
D) Disk
✅ Answer: B
8️⃣5️⃣ Method overloading depends on:
A) Return type
B) Parameter list
C) Access modifier
D) Static
✅ Answer: B
9️⃣0️⃣ Static method can access:
A) Instance variable directly
B) Only static members
C) this
D) Object automatically
✅ Answer: B
9️⃣5️⃣ Default access modifier allows access within:
A) Class only
B) Package only
C) Everywhere
D) Subclass only
✅ Answer: B
1️⃣0️⃣0️⃣ Stack memory stores:
A) Objects
B) Local variables
C) Static variables
D) Heap objects
✅ Answer: B
✅ Final Conclusion
These 100 MCQs cover:
✔ Java Basics
✔ JVM, JRE, JDK
✔ Data Types
✔ Operators
✔ Loops
✔ Classes & Objects
✔ Methods
✔ Constructors
✔ Static
✔ Encapsulation
✔ Abstract Class
✔ Memory Concepts
Practicing these regularly will strengthen exam performance and conceptual clarity 💪