CDCDAC Prep
PGCP-ACCMCE (CCE Modules Exam)•20 Questions

Object-Oriented Programming with Java Practice MCQs

Topic Covered in this Question Set

Java Platform, JVM Architecture, JDK and Primitive Types

Click on an option to check your answer immediately. Full solution & explanation provided for every question.

Interactive Practice Mode

Object-Oriented Programming with Java Free MCQs

Select an option to test your knowledge with real exam questions and instant explanations.

Total20
Correct0
Wrong0
Progress: 0 of 20 answered0% Accuracy
Q1 of 20

Which JDK tool compiles .java source files into .class files?

Open topic in App →
Q2 of 20

What does javac normally write into a .class file?

Open topic in App →
Q3 of 20

Which JVM component verifies, prepares and resolves a class (linking) and then initializes it, before any of its code runs?

Open topic in App →
Q4 of 20

Which part of the Java platform contains development tools such as javac in addition to a runtime?

Open topic in App →
Q5 of 20

What does the JVM's just-in-time (JIT) compiler do?

Open topic in App →
Q6 of 20

In Java 8, 11 or 17, which method declaration can the standard java launcher use as a program's entry point?

Open topic in App →
Q7 of 20

Why is compiled Java code described as platform independent?

Open topic in App →
Q8 of 20

What is the range of values of a Java byte?

Open topic in App →
Q9 of 20

What does a Java char value represent?

Open topic in App →
Q10 of 20

What does this program print? ```java class Defaults { static int count; static double rate; static boolean flag; public static void main(String[] args) { System.out.println(count + " " + rate + " " + flag); } } ```

Open topic in App →
Q11 of 20

Which suffix must be added so that `long big = 8000000000;` compiles?

Open topic in App →
Q12 of 20

What does the declaration `import java.util.ArrayList;` do?

Open topic in App →
Q13 of 20

Which setting tells java and javac where to search for user classes and JAR libraries?

Open topic in App →
Q14 of 20

A method uses a variable name that was never declared. When is this reported?

Open topic in App →
Q15 of 20

Which of these is a reference type rather than one of Java's eight primitive types?

Open topic in App →
Q16 of 20

What does this code print? ```java int max = Integer.MAX_VALUE; // 2147483647 System.out.println(max + 1); ```

Open topic in App →
Q17 of 20

What does this code print? ```java char c = 'A'; System.out.println(c + 1); c++; System.out.println(c); ```

Open topic in App →
Q18 of 20

Two threads execute the same method at the same time. Which JVM runtime data area does each thread get its own separate copy of?

Open topic in App →
Q19 of 20

What does this program print? ```java public class Init { static int x = 5; static { x = x * 2; System.out.print("S" + x + " "); } public static void main(String[] args) { System.out.print("M" + x); } } ```

Open topic in App →
Q20 of 20

A file named Test.java contains only: ```java public class Hello { public static void main(String[] args) { } } ``` What happens when you run `javac Test.java`?

Open topic in App →
Need to review the concepts?

Read Object-Oriented Programming with Java Study Notes

Review complete topic notes, syntax guides, code examples, and summary tables.

Read Free Study Notes →