Search the courses, subjects, tracks, games and features, or jump straight to a page.
2 cards from this section. Quick, good the night before a test.
Define what a method is in object-oriented programming.
Think about what an object can do.
What part of the method declaration specifies its return type?
What do you expect the method to return?
What is a method in object-oriented programming?
Would you describe actions with a variable?
True or False: Methods can return values.
Consider if a method outputs something.
Create a comprehensive class called Smartphone with methods to make calls, send texts, and check battery life. Include constructors and demonstrate usage.
Think about what actions are typical for a smartphone.
Design a method to calculate the area of a rectangle in a class called Rectangle. The method should take width and height as parameters.
What formula do you need to calculate an area?
5 more questions in this section. Enroll free to practise them all.
Enroll free