JAVA · ОСНОВЫ · LESSON 18
The method answers.
return · about 14 minutes
Learning with progressRead the summary for free. To save the work, log in to the account.
Type the code yourself
Type an example manually. Check the signs and brackets.
public class Main {
public static void main(String[] args) {
System.out.println(add(2, 3));
}
static int add(int a, int b) {
return a + b;
}
}Open the editor for class workSolve it yourself
Create static int multiply (Zint a, int b), which returns the work of a and b. In main output the result multiply(3, 4).
The answer is hidden. Use similar examples from the lesson notes.
Opening up your homework