Learn how to read a method, call it correctly, and use Java's built-in tools with confidence.
Click the choices and see how one order becomes a method call.
Choose one button first. That decides which tool you want to use.
These are the choices you pass in before the machine can do the job.
Choose the inputs, then press Place Order.
In Java, the pattern is still tool, inputs, and result.
orderDrink names the tool. drink stores the result. A method is a named tool that does a job or gives a result.
A method signature shows return type, name, and parameters.
Which call matches the method signature?
Which call correctly matches pow(double a, double b)?
Do not guess. Read the tools first.
Java already gives you many ready-made tools.
Math for calculations. abs()pow()sqrt()String methods for text. length()substring()equals()Scanner for keyboard input. nextInt()nextDouble()nextLine()Java gives you ready-made methods for common calculations
Some methods return a value, and some use void.
What does this method call print?
Generate a random number from 1 to 6.
Java starts with a random decimal between 0.0 and 1.0.
Use multiplication and casting to build the range you want.
6, cast to int, then add 1. 0 to 9, then shift the range by 10. Key ideas for methods, APIs, and the Math class
A method is a named tool that does a job or gives back a result.
A signature shows the return type, method name, and parameters.
Some methods return a value like int or double, and some use void.
Java already gives you ready-made tools such as Math, String, and Scanner.
Check the CED appendix before guessing.
abs or sqrt.System.out.println.pow or sqrt.1 to 6.System.out.println.