Search the courses, subjects, tracks, games and features, or jump straight to a page.
3 cards from this section. Quick, good the night before a test.
What does a reference variable do?
Think about what allows us to interact with objects.
Define a constructor.
How is it related to the class?
What does a reference variable point to?
Think about what allows interaction with this object.
True or False: A constructor has a return type.
Consider the signature of a constructor.
Create a class Book with attributes title and author. Write a constructor to initialize these fields and demonstrate creating an instance of Book.
This involves defining attributes and initializing them within the constructor.
Compare two objects of class Employee using both == and .equals(). Explain the differences in your output.
You will need to override `.equals()` in the Employee class.
5 more questions in this section. Enroll free to practise them all.
Enroll free