Search the courses, subjects, tracks, games and features, or jump straight to a page.
4 cards from this section. Quick, good the night before a test.
What is an object in Java?
Think of real-world entities.
What keyword is used to create an object?
Remember the syntax: ClassName objectName = new ClassName();
Which keyword is used to instantiate an object in Java?
Think of the syntax for creating an object.
True or False: A constructor has a return type.
Consider how you define a function compared to a constructor.
Create a Book class with attributes for title and author, include a constructor and a method to display the book information. Create an object and display its information.
Remember to use the 'new' keyword to create the object.
Explain how you would use garbage collection in a program that dynamically creates many objects over time.
Think about how it helps in memory management without manual deletion.
5 more questions in this section. Enroll free to practise them all.
Enroll free