Docsity

Oracle Certified Java SE Programmer Style Practice Exam (Language Basics, OOP, Exception, Exams of Computer Science

Toggle sidebar
bg1
Oracle Certified Java SE Programmer Style
Practice Exam (Language Basics, OOP,
Exceptions, Collections, Streams, Lambdas,
Concurrency, Modules) - 300 Original
Questions with Answers
Original Java SE programming concepts study practice (1Z0-808, 811, 815 and 819
style)
300 Multiple-Choice Practice Questions
with Answer Key and Explanations
2026 Edition
Oracle Certified Java SE Programmer Style Practice Exam (Language Basics, OOP, Exceptions, Collections, Streams, Lambdas, Concurrency, Modules)
- 300 Original Questions with Answers | Page 1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28

Partial preview of the text

Download Oracle Certified Java SE Programmer Style Practice Exam (Language Basics, OOP, Exception and more Exams Computer Science in PDF only on Docsity!

Oracle Certified Java SE Programmer Style

Practice Exam (Language Basics, OOP,

Exceptions, Collections, Streams, Lambdas,

Concurrency, Modules) - 300 Original

Questions with Answers

Original Java SE programming concepts study practice (1Z0-808, 811, 815 and 819

style)

300 Multiple-Choice Practice Questions

with Answer Key and Explanations

2026 Edition Oracle Certified Java SE Programmer Style Practice Exam (Language Basics, OOP, Exceptions, Collections, Streams, Lambdas, Concurrency, Modules)

Exam Overview This original practice exam covers core Java SE concepts: language basics and data types, object oriented programming, exceptions and assertions, strings and the API, collections and generics, lambdas and streams, concurrency and I/O, modules and packaging, and applied scenarios. It is study material, is not affiliated with Oracle and is not an official exam or certification. Java versions differ, so please confirm details against current official documentation. Exam Oracle Certified Java SE Programmer Style Practice Exam (Language Basics, OOP, Exceptions, Collections, Streams, Lambdas, Concurrency, Modules) - 300 Original Questions with Answers Intended for Learners and developers studying core Java SE programming concepts Number of questions 300 multiple-choice (four options, one best answer) Content areas 9 Suggested time 5 hours (about 60 seconds per question) Suggested passing target 80% or higher (240 of 300) Answer format The correct answer and explanation appear directly after each question

Content Blueprint

Content area Questions Share of exam Language Basics and Data Types 33 11% Object Oriented Programming 33 11% Exceptions and Assertions 33 11% Strings and Core API 33 11% Collections and Generics 33 11% Lambdas and Streams 33 11% Concurrency and I/O 33 11% Modules and Packaging 33 11% Applied Scenarios 36 12%

How to Use This Exam

 Cover the answer lines with a sheet of paper and attempt each question before checking.  Work one content area at a time, or take all questions in one timed sitting to simulate test day.  Mark every question you miss or guess on, then reread its explanation and the related reference material.  Repeat the missed questions after a few days; aim to explain why each wrong option is wrong.

Reference Materials Used

 General Java SE programming concepts (confirm against current official documentation) Note: This is an independent practice resource written to the published content areas for this exam. It is not affiliated with or endorsed by the testing organization, and it does not contain actual exam questions. Laws, codes, fees and guidelines change; confirm current requirements with the official candidate handbook and references. Oracle Certified Java SE Programmer Style Practice Exam (Language Basics, OOP, Exceptions, Collections, Streams, Lambdas, Concurrency, Modules)

Section 1: Language Basics and Data Types

1. Java is: A. A spreadsheet B. A markup language C. A compiled and interpreted object oriented language D. A database Correct answer: C. A compiled and interpreted object oriented language Explanation: Bas. 2. JVM: A. Java Virtual Machine executing bytecode B. A compiler only C. A text editor D. A database Correct answer: A. Java Virtual Machine executing bytecode Explanation: Bas. 3. JDK: A. Runtime only B. Development kit including compiler and tools C. A browser D. A database Correct answer: B. Development kit including compiler and tools Explanation: Bas. 4. JRE concept: A. Compiler only B. A browser C. A database D. Runtime environment to run Java programs Correct answer: D. Runtime environment to run Java programs Explanation: Bas. 5. Bytecode: A. Platform independent compiled form B. Source code C. Machine code only D. Automatic from smaller to larger type Correct answer: A. Platform independent compiled form Explanation: Bas. Oracle Certified Java SE Programmer Style Practice Exam (Language Basics, OOP, Exceptions, Collections, Streams, Lambdas, Concurrency, Modules)

6. javac: A. Runs programs B. Deletes files C. Edits files D. Compiles source files to bytecode Correct answer: D. Compiles source files to bytecode Explanation: Bas. 7. java command: A. Compiles code B. Deletes files C. Launches the JVM to run a class D. Edits files Correct answer: C. Launches the JVM to run a class Explanation: Bas. 8. main method signature: A. public void main() B. public static void main(String[] args) C. static main only D. Launches the JVM to run a class Correct answer: B. public static void main(String[] args) Explanation: Bas. 9. Primitive types: A. Automatic from smaller to larger type B. Language features vary by version C. byte short int long float double char boolean D. A compiled and interpreted object oriented language Correct answer: C. byte short int long float double char boolean Explanation: Bas. 10. int size: A. 8 bits B. 16 bits C. 32 bits D. 64 bits Correct answer: C. 32 bits Explanation: Bas. Oracle Certified Java SE Programmer Style Practice Exam (Language Basics, OOP, Exceptions, Collections, Streams, Lambdas, Concurrency, Modules)

16. Default object reference: A. 0 B. null C. empty D. undefined Correct answer: B. null Explanation: Bas. 17. Local variables: A. Have defaults B. Must be initialized before use C. Are static D. Are final Correct answer: B. Must be initialized before use Explanation: Bas. 18. var keyword: A. Local variable type inference B. A new class C. A constant D. A package Correct answer: A. Local variable type inference Explanation: Bas. 19. Final variable: A. Can change B. Is static C. Cannot be reassigned D. Is null Correct answer: C. Cannot be reassigned Explanation: Bas. 20. Integer overflow: A. Throws exception B. Stops program C. Converts to long D. Wraps around silently Correct answer: D. Wraps around silently Explanation: Bas. Oracle Certified Java SE Programmer Style Practice Exam (Language Basics, OOP, Exceptions, Collections, Streams, Lambdas, Concurrency, Modules)

21. Widening conversion: A. Needs cast B. Loses data C. Not allowed D. Automatic from smaller to larger type Correct answer: D. Automatic from smaller to larger type Explanation: Bas. 22. Narrowing conversion: A. Is automatic B. Needs an explicit cast C. Never loses data D. Not allowed Correct answer: B. Needs an explicit cast Explanation: Bas. 23. Operators precedence: A. Multiplication before addition B. Left to right only C. Addition first D. Conditional branching Correct answer: A. Multiplication before addition Explanation: Bas. 24. Integer division: A. Compiles source files to bytecode B. Returns double C. Truncates the fractional part D. Throws error Correct answer: C. Truncates the fractional part Explanation: Bas. 25. Modulo operator: A. Counted iteration B. Remainder of division C. length field not method D. 64 bit floating point Correct answer: B. Remainder of division Explanation: Bas. Oracle Certified Java SE Programmer Style Practice Exam (Language Basics, OOP, Exceptions, Collections, Streams, Lambdas, Concurrency, Modules)

31. switch statement: A. Truncates the fractional part B. Handles exceptions C. Defines classes D. Selects among cases Correct answer: D. Selects among cases Explanation: Bas. 32. Switch expressions: A. Not available B. Newer form returning a value C. Only old form D. ++ adds one Correct answer: B. Newer form returning a value Explanation: Bas. 33. for loop: A. Conditional only B. Counted iteration C. Exception only D. Class only Correct answer: B. Counted iteration Explanation: Bas. Oracle Certified Java SE Programmer Style Practice Exam (Language Basics, OOP, Exceptions, Collections, Streams, Lambdas, Concurrency, Modules)

Section 2: Object Oriented Programming

34. Class: A. An object instance B. A method C. Blueprint for objects D. A package Correct answer: C. Blueprint for objects Explanation: Oop. 35. Object: A. Instance of a class B. A blueprint C. A package D. A method Correct answer: A. Instance of a class Explanation: Oop. 36. Constructor: A. Returns values B. Is a method always C. Deletes objects D. Initializes new objects Correct answer: D. Initializes new objects Explanation: Oop. 37. Default constructor: A. Always absent B. Needs parameters C. A class can implement many interfaces D. Provided if no constructor declared Correct answer: D. Provided if no constructor declared Explanation: Oop. 38. this keyword: A. Refers to the current object B. Refers to parent C. Refers to class only D. Refers to nothing Correct answer: A. Refers to the current object Explanation: Oop. Oracle Certified Java SE Programmer Style Practice Exam (Language Basics, OOP, Exceptions, Collections, Streams, Lambdas, Concurrency, Modules)

44. Inheritance: A. Copy only B. Subclass reuses parent members C. Delete members D. Hide members Correct answer: B. Subclass reuses parent members Explanation: Oop. 45. extends: A. Implements an interface B. Imports a package C. Creates a subclass D. Defines a method Correct answer: C. Creates a subclass Explanation: Oop. 46. implements: A. Creates a subclass B. Implements an interface C. Imports a package D. Defines a field Correct answer: B. Implements an interface Explanation: Oop. 47. Single inheritance of classes: A. A class extends one class B. Many classes C. No classes D. Interfaces only Correct answer: A. A class extends one class Explanation: Oop. 48. Multiple interface implementation: A. Only one B. Runs for each object creation C. Cannot be instantiated and may have abstract methods D. A class can implement many interfaces Correct answer: D. A class can implement many interfaces Explanation: Oop. Oracle Certified Java SE Programmer Style Practice Exam (Language Basics, OOP, Exceptions, Collections, Streams, Lambdas, Concurrency, Modules)

49. Method overriding: A. Subclass redefines a parent method B. Same class same name C. Hides fields D. Deletes methods Correct answer: A. Subclass redefines a parent method Explanation: Oop. 50. Method overloading: A. Redefines parent B. Same signature C. Same name different parameters D. Deletes methods Correct answer: C. Same name different parameters Explanation: Oop. 51. @Override: A. Required always B. Annotation checking overriding C. Deletes methods D. Hides methods Correct answer: B. Annotation checking overriding Explanation: Oop. 52. Polymorphism: A. Single behavior B. No behavior C. Runs for each object creation D. Same call different behavior by runtime type Correct answer: D. Same call different behavior by runtime type Explanation: Oop. 53. Dynamic dispatch: A. Compile time only B. Method chosen at runtime by object type C. Unnamed class defined at creation D. Refers to the parent class Correct answer: B. Method chosen at runtime by object type Explanation: Oop. Oracle Certified Java SE Programmer Style Practice Exam (Language Basics, OOP, Exceptions, Collections, Streams, Lambdas, Concurrency, Modules)

59. Private interface methods: A. Never allowed B. Only default C. Provided if no constructor declared D. Allowed since Java 9 Correct answer: D. Allowed since Java 9 Explanation: Oop. 60. Functional interface: A. Interface with none B. Interface with one abstract method C. Interface with many D. Equal objects must have equal hash codes Correct answer: B. Interface with one abstract method Explanation: Oop. 61. Static members: A. Belong to the class not instances B. Belong to instances C. Are private D. Are final Correct answer: A. Belong to the class not instances Explanation: Oop. 62. Static initializer: A. Runs per object B. Never runs C. Runs once when the class loads D. Refers to the parent class Correct answer: C. Runs once when the class loads Explanation: Oop. 63. Instance initializer: A. Runs once B. Equal objects must have equal hash codes C. A class can implement many interfaces D. Runs for each object creation Correct answer: D. Runs for each object creation Explanation: Oop. Oracle Certified Java SE Programmer Style Practice Exam (Language Basics, OOP, Exceptions, Collections, Streams, Lambdas, Concurrency, Modules)

64. Final class: A. Can be extended B. Cannot be extended C. Is abstract D. Is interface Correct answer: B. Cannot be extended Explanation: Oop. 65. Final method: A. Can be overridden B. Is abstract C. Is static D. Cannot be overridden Correct answer: D. Cannot be overridden Explanation: Oop. 66. Inner classes: A. Provided if no constructor declared B. Runs for each object creation C. Classes defined inside classes D. Refers to the current object Correct answer: C. Classes defined inside classes Explanation: Oop. Oracle Certified Java SE Programmer Style Practice Exam (Language Basics, OOP, Exceptions, Collections, Streams, Lambdas, Concurrency, Modules)

72. try catch: A. Handle exceptions B. Declare variables C. Define classes D. Import packages Correct answer: A. Handle exceptions Explanation: Exc. 73. finally: A. Runs only on error B. Never runs C. Runs whether or not an exception occurs D. Avoid as fields and parameters Correct answer: C. Runs whether or not an exception occurs Explanation: Exc. 74. Multi catch: A. Not allowed B. Catch several types in one block C. Creating stack traces has cost D. Can override earlier returns and is discouraged Correct answer: B. Catch several types in one block Explanation: Exc. 75. try with resources: A. Auto closes AutoCloseable resources B. Manual only C. Never closes D. Catch several types in one block Correct answer: A. Auto closes AutoCloseable resources Explanation: Exc. 76. AutoCloseable: A. Catch several types in one block B. Compile error when a broader catch precedes C. Close resources reliably D. Interface for resources closed automatically Correct answer: D. Interface for resources closed automatically Explanation: Exc. Oracle Certified Java SE Programmer Style Practice Exam (Language Basics, OOP, Exceptions, Collections, Streams, Lambdas, Concurrency, Modules)

77. Suppressed exceptions: A. Never occur B. Attached when close also throws C. Catch several types in one block D. Serious problems usually not handled Correct answer: B. Attached when close also throws Explanation: Exc. 78. throw: A. Declares exceptions B. Catches exceptions C. Raises an exception object D. Deletes exceptions Correct answer: C. Raises an exception object Explanation: Exc. 79. throws: A. Declares exceptions a method may throw B. Raises exceptions C. Catches exceptions D. Deletes exceptions Correct answer: A. Declares exceptions a method may throw Explanation: Exc. 80. Custom exceptions: A. Not allowed B. Use -ea at runtime C. Must be handled or declared D. Extend Exception or RuntimeException Correct answer: D. Extend Exception or RuntimeException Explanation: Exc. 81. Catch order: A. Specific before general B. General before specific C. Declares exceptions a method may throw D. Invalid array index Correct answer: A. Specific before general Explanation: Exc. Oracle Certified Java SE Programmer Style Practice Exam (Language Basics, OOP, Exceptions, Collections, Streams, Lambdas, Concurrency, Modules)