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 is a method in Java?
Think about the tasks or actions we perform in programming.
Provide a simple example of an object in a class.
Consider real-world entities.
What defines a method in Java?
Remember the purpose of a method.
True or False: An object can call its own methods.
Think about how objects function in Java.
Design a class called Car with properties for make, model, and a method to display the full description of the car. Instantiate an object and demonstrate calling this method.
Think about how to format the output string.
Create a simple class named Animal with a property for species and a method sound() that prints a sound relevant to that animal. How would you call this method?
Focus on how to define and use methods based on properties.
4 more questions in this section. Enroll free to practise them all.
Enroll free