





















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
ORACLE CERTIFIED ASSOCIATE JAVA PROGRAMMER EXAMINATION QUESTIONS AND CORRECT ANSWERS (VERIFIED ANSWERS) PLUS RATIONALES 2026 Q&A | INSTANT DOWNLOAD PDF
Typology: Exams
1 / 29
This page cannot be seen from the preview
Don't miss anything!






















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
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