Courseiva
Utilizing Java Object-Oriented ApproachmediumMultiple SelectObjective-mapped

1Z0-829 Utilizing Java Object-Oriented Approach Practice Question

Which two statements are true about records in Java? (Choose two.)

⚠ Common exam trap

Watch out — candidates often confuse records with regular classes and assume they can be abstract, extend other classes, or add extra instance fields, but the Java language explicitly restricts records to be final, to extend only java.lang.Record, and to have all instance fields derived from the component list.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Records provide a canonical constructor that initializes all components.

A record in Java implicitly provides a canonical constructor that accepts all the components declared in the record header and initializes them. This constructor is generated by the compiler unless a custom canonical constructor is explicitly defined, ensuring that all component fields are set upon instantiation.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Records provide a canonical constructor that initializes all components.

    Why this is correct

    The canonical constructor initializes all record components.

  • Records can be abstract.

    Why it's wrong here

    Records are final and cannot be abstract.

  • Records can extend other classes.

    Why it's wrong here

    Records implicitly extend java.lang.Record and cannot extend other classes.

  • Records can have instance fields that are not part of the record component list.

    Why it's wrong here

    All instance fields must be declared as components; additional instance fields are not allowed.

  • Records are implicitly final.

    Why this is correct

    Records are implicitly final; they cannot be extended.

About these practice questions

This 1Z0-829 question is part of Courseiva's 513-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This 1Z0-829 practice question is part of Courseiva's free Oracle certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 1Z0-829 exam.