zuai-logo
  • Home

  • Mock Exam

  • Cliffs

  • Talk to ZuAI

  • Request a Feature

zuai-logo
  1. Computer Science A
FlashcardFlashcard
Study GuideStudy GuideQuestion BankQuestion Bank

What are the differences between pass-by-value and pass-by-reference?

Pass-by-value: A copy is passed, original value unaffected. | Pass-by-reference: The memory address is passed, original value can be modified.

Revise later
SpaceTo flip
If confident

All Flashcards

What are the differences between pass-by-value and pass-by-reference?
Pass-by-value: A copy is passed, original value unaffected. | Pass-by-reference: The memory address is passed, original value can be modified.
What are the differences between a default constructor and a parameterized constructor?
Default constructor: No parameters, provides default initialization. | Parameterized constructor: Accepts parameters, allows custom initialization.
What is a constructor?
A special method that creates new objects and sets them up with initial characteristics.
What is the 'new' keyword used for?
Used to call the constructor and create a new object.
What is a parameter list in a constructor?
Values provided to the constructor to initialize the object's attributes.
What is pass-by-value?
A copy of the value is passed to the method; changes inside the method don't affect the original value.
What is pass-by-reference?
A reference (memory address) is passed to the method; changes inside the method do affect the original object.
What is a constructor signature?
The constructor's blueprint, including the class name and the parameter types.
What is constructor overloading?
Having multiple constructors in a class with different parameter lists.
What is a default constructor?
A constructor with no parameters.
What is a null object?
An object that doesn't exist; its reference variable stores 'null'.
What is a NullPointerException?
An error that occurs when you try to call a method on a null object.
How is constructor overloading applied in real-world scenarios?
Creating objects with varying levels of detail, such as creating a 'Product' object with just a name or with name, price, and description.
How are constructors used in database applications?
Constructors can be used to create objects representing database records, initializing them with data retrieved from the database.