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.
Define what a method is in Java.
Think about how we give instructions in code.
What is a static method?
Remember, it doesn't need an instance.
What is a method in Java?
Think about what methods do in coding.
True or False: A constructor has the same name as the class it defines.
Consider how objects are initialized.
Create a class Book with a default constructor and a parameterized constructor that accepts title and author. Additionally, implement a method to display these details.
Focus on defining your constructors and the display method correctly.
Design a class Calculator that overloads a method (e.g., 'subtract') to handle both integers and doubles. Ensure methods can complete returns successfully.
Remember to maintain the same method name while changing parameter types.
5 more questions in this section. Enroll free to practise them all.
Enroll free