ORACLE CERTIFIED ASSOCIATE JAVA PROGRAMMER EXAMINATION QUESTIONS AND CORRECT ANSWERS, Exams of Java Programming

ORACLE CERTIFIED ASSOCIATE JAVA PROGRAMMER EXAMINATION QUESTIONS AND CORRECT ANSWERS (VERIFIED ANSWERS) PLUS RATIONALES 2026 Q&A | INSTANT DOWNLOAD PDF

Typology: Exams

2025/2026

Available from 04/27/2026

masterystudyhub
masterystudyhub 🇺🇸

4.7

(3)

4.4K documents

1 / 29

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
ORACLE CERTIFIED ASSOCIATE JAVA
PROGRAMMER EXAMINATION
QUESTIONS AND CORRECT ANSWERS
(VERIFIED ANSWERS) PLUS RATIONALES
2026 Q&A | INSTANT DOWNLOAD PDF
1. What is the correct way to declare the main method in Java?
A. public static void main(String args)
B. public void main(String[] args)
C. public static void main(String[] args)
D. static public void Main(String[] args)
Correct Answer: C
Rationale: The Java entry point must be public static void main(String[]
args). It must be public so the JVM can access it, static so it can run
without object creation, and use a String array as parameter.
2. Which keyword is used to inherit a class in Java?
A. implements
B. inherit
C. extends
D. super
Correct Answer: C
Rationale: The extends keyword is used for class inheritance in Java,
allowing a subclass to acquire properties and methods of a superclass.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d

Partial preview of the text

Download ORACLE CERTIFIED ASSOCIATE JAVA PROGRAMMER EXAMINATION QUESTIONS AND CORRECT ANSWERS and more Exams Java Programming in PDF only on Docsity!

ORACLE CERTIFIED ASSOCIATE JAVA

PROGRAMMER EXAMINATION

QUESTIONS AND CORRECT ANSWERS

(VERIFIED ANSWERS) PLUS RATIONALES

2026 Q&A | INSTANT DOWNLOAD PDF

  1. What is the correct way to declare the main method in Java? A. public static void main(String args) B. public void main(String[] args) C. public static void main(String[] args) D. static public void Main(String[] args) Correct Answer: C Rationale: The Java entry point must be public static void main(String[] args). It must be public so the JVM can access it, static so it can run without object creation, and use a String array as parameter.
  2. Which keyword is used to inherit a class in Java? A. implements B. inherit C. extends D. super Correct Answer: C Rationale: The extends keyword is used for class inheritance in Java, allowing a subclass to acquire properties and methods of a superclass.
  1. What is the default value of an int variable in a class? A. 0 B. null C. undefined D. 1 Correct Answer: A Rationale: Instance variables of type int are automatically initialized to 0 in Java if not explicitly set.
  2. Which of the following is NOT a Java primitive type? A. int B. float C. String D. char Correct Answer: C Rationale: String is a reference type (class), not a primitive type in Java.
  3. Which operator is used for logical AND? A. & B. && C. | D. || Correct Answer: B Rationale: && is the logical AND operator used in conditional expressions with short-circuit evaluation.
  4. What is method overloading? A. Same method name, same parameters B. Different method names C. Same method name, different parameters

10.Which package is imported by default in Java? A. java.util B. java.io C. java.lang D. java.net Correct Answer: C Rationale: The java.lang package is automatically imported in every Java program. 11.What is the size of a char in Java? A. 8 bits B. 16 bits C. 32 bits D. 64 bits Correct Answer: B Rationale: Java char is 16-bit Unicode character type. 12.Which keyword is used to create an object? A. class B. new C. create D. object Correct Answer: B Rationale: The new keyword is used to instantiate objects in Java. 13.Which of these is immutable? A. String B. StringBuilder C. Array

D. Object Correct Answer: A Rationale: String objects are immutable, meaning their value cannot be changed after creation. 14.What is polymorphism? A. Multiple classes B. Same method behaves differently C. Data hiding D. Inheritance Correct Answer: B Rationale: Polymorphism allows methods to behave differently based on the object that invokes them. 15.Which keyword is used for exception handling? A. try B. catch C. finally D. all of the above Correct Answer: D Rationale: Exception handling in Java uses try, catch, and finally blocks together. 16.What is the default value of a boolean? A. true B. false C. null D. 0 Correct Answer: B Rationale: Boolean instance variables default to false in Java.

C. switch D. do-while Correct Answer: C Rationale: switch is a decision-making statement, not a loop. 21.Which access modifier allows access everywhere? A. private B. protected C. public D. default Correct Answer: C Rationale: public allows access from any class in any package. 22.What is byte range? A. - 128 to 127 B. 0 to 255 C. - 32768 to 32767 D. - 1 to 1 Correct Answer: A Rationale: Java byte is an 8-bit signed integer ranging from - 128 to 127. 23.Which keyword is used for interface implementation? A. extends B. implements C. inherit D. uses Correct Answer: B Rationale: Classes use implements to implement interfaces.

24.What is JVM? A. Java Variable Machine B. Java Virtual Machine C. Java Verified Method D. Java Visual Model Correct Answer: B Rationale: JVM executes Java bytecode and provides platform independence. 25.Which of these is NOT OOP principle? A. Encapsulation B. Polymorphism C. Compilation D. Inheritance Correct Answer: C Rationale: Compilation is not an OOP principle; OOP includes encapsulation, inheritance, polymorphism, and abstraction. 26.What is method overriding? A. Same method, same class B. Same method, different class, same signature C. Different method names D. Same method, different parameters Correct Answer: B Rationale: Method overriding occurs when a subclass provides a specific implementation of a superclass method. 27.Which keyword is used to prevent inheritance? A. static B. final

31.Which keyword is used for inheritance of interface? A. extends B. implements C. inherit D. interface Correct Answer: A Rationale: Interfaces extend other interfaces using extends. 32.What is default value of reference variable? A. 0 B. false C. null D. undefined Correct Answer: C Rationale: Reference variables default to null if not initialized. 33.Which is used to handle multiple exceptions? A. multiple catch blocks B. single catch only C. try only D. throw only Correct Answer: A Rationale: Java allows multiple catch blocks for different exception types. 34.What is recursion? A. Looping B. Method calling itself C. Class inheritance D. Object creation

Correct Answer: B Rationale: Recursion is when a method calls itself to solve a problem. 35.Which keyword is used to throw an exception? A. throws B. throw C. catch D. final Correct Answer: B Rationale: throw is used to explicitly throw an exception object. 36.What is array index start? A. 1 B. - 1 C. 0 D. depends Correct Answer: C Rationale: Java arrays are zero-indexed. 37.Which is a wrapper class? A. int B. Integer C. float D. char Correct Answer: B Rationale: Integer is the wrapper class for primitive int. 38.Which operator is ternary? A. ?:

42.What is inheritance? A. Creating objects B. Acquiring properties of another class C. Overloading methods D. Exception handling Correct Answer: B Rationale: Inheritance allows one class to acquire properties and behavior from another. 43.Which of these is thread-related keyword? A. run B. start C. both A and B D. thread Correct Answer: C Rationale: start() begins thread execution and run() contains thread logic. 44.What is static variable? A. Object-level variable B. Class-level variable C. Local variable D. Temporary variable Correct Answer: B Rationale: Static variables belong to the class rather than objects. 45.Which keyword is used to refer superclass? A. this B. super C. base

D. parent Correct Answer: B Rationale: super refers to the immediate parent class. 46.Which is not a Java feature? A. Platform independent B. Object-oriented C. Pointers D. Robust Correct Answer: C Rationale: Java does not support explicit pointers like C/C++. 47.What is casting? A. Looping B. Type conversion C. Inheritance D. Compilation Correct Answer: B Rationale: Casting converts one data type into another. 48.Which keyword is used for constant? A. const B. final C. static D. define Correct Answer: B Rationale: final is used to declare constants in Java.

D. .bin Correct Answer: B Rationale: Java source compiles into .class bytecode executed by JVM. 53.Which method is used to get string length? A. length() B. size() C. getLength() D. count() Correct Answer: A Rationale: length() returns number of characters in a string. 54.What is exception? A. Error handling mechanism B. Program crash C. Loop D. Object Correct Answer: A Rationale: Exceptions handle runtime errors gracefully. 55.Which keyword handles checked exceptions? A. try-catch B. throw only C. final D. static Correct Answer: A Rationale: Checked exceptions must be handled using try-catch or declared with throws.

56.Which is a marker interface? A. Runnable B. Serializable C. Thread D. Cloneable class Correct Answer: B Rationale: Serializable is a marker interface with no methods. 57.What is method signature? A. Method name only B. Name + parameters C. Return type D. Access modifier Correct Answer: B Rationale: Method signature includes method name and parameter list. 58.Which memory area stores objects? A. Stack B. Heap C. Register D. CPU Correct Answer: B Rationale: Objects are stored in heap memory. 59.What is stack memory used for? A. Objects B. Methods and variables C. Files D. Databases

B. &

C. &&

D. ::

Correct Answer: A Rationale: + is used for string concatenation in Java. 64.What is garbage collection? A. Memory allocation B. Memory cleanup C. Compilation D. Execution Correct Answer: B Rationale: Garbage collector frees unused memory automatically. 65.Which method starts thread execution? A. run() B. start() C. execute() D. begin() Correct Answer: B Rationale: start() invokes the thread scheduler. 66.What is interface? A. Class with methods B. Blueprint of class C. Abstract contract D. Object Correct Answer: C Rationale: Interfaces define abstract methods for implementation.

67.Which keyword is used for anonymous class? A. new B. class C. anon D. create Correct Answer: A Rationale: Anonymous classes are created using new keyword with implementation. 68.What is compile-time polymorphism? A. Overloading B. Overriding C. Inheritance D. Abstraction Correct Answer: A Rationale: Method overloading is resolved at compile time. 69.What is runtime polymorphism? A. Overloading B. Overriding C. Encapsulation D. Compilation Correct Answer: B Rationale: Method overriding is resolved at runtime. 70.Which keyword prevents method override? A. static B. final C. private D. abstract