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
Q3 of 20
Which JVM component verifies, prepares and resolves a class (linking) and then initializes it, before any of its code runs?
Q4 of 20
Which part of the Java platform contains development tools such as javac in addition to a runtime?
Q6 of 20
In Java 8, 11 or 17, which method declaration can the standard java launcher use as a program's entry point?
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); } } ```
Q13 of 20
Which setting tells java and javac where to search for user classes and JAR libraries?
Q14 of 20
A method uses a variable name that was never declared. When is this reported?
Q15 of 20
Which of these is a reference type rather than one of Java's eight primitive types?
Q16 of 20
What does this code print? ```java int max = Integer.MAX_VALUE; // 2147483647 System.out.println(max + 1); ```
Q17 of 20
What does this code print? ```java char c = 'A'; System.out.println(c + 1); c++; System.out.println(c); ```
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?
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); } } ```
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`?
Need to review the concepts?
Read Free Study Notes →Read Object-Oriented Programming with Java Study Notes
Review complete topic notes, syntax guides, code examples, and summary tables.