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 the return type of a method that returns an integer?
Look for common data types in Java.
What keyword is used to define a method that does not return a value?
This is a special keyword in Java for non-returning methods.
What does a method's return type define?
Focus on the value being returned.
True or False: A method can have multiple return types.
Think about method signatures.
Design a method named calculate that takes coordinates and returns the distance between two points. Determine the return type and the formula you'll use.
Recall the distance formula from geometry.
Create two methods calculateInterest — one that calculates simple interest and another for compound interest. What would be different in their parameters? Provide return types for each.
Consider how each interest type is calculated.
5 more questions in this section. Enroll free to practise them all.
Enroll free