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 a method in Java?
Think about functionalities in classes.
Can a method return a value?
Consider functions you use in mathematics.
What is the primary purpose of a method in Java?
Think of the tasks an object can perform.
True or False: A method can be void and not return any value.
Reflect on methods that just perform actions.
Create a Book class with methods to set and get the title and author. Implement the methods and show how you would call them.
Consider encapsulation and how methods interact with instance variables.
Write a method in a class Calculator that takes two integers and returns their sum. Describe how the method operates.
Reflect on the flow of data and how methods provide outputs based on inputs.
6 more questions in this section. Enroll free to practise them all.
Enroll free