Complete the code to declare a method that takes one integer parameter.
public void printNumber([1] number) {
System.out.println(number);
}The method parameter must be of type int to accept an integer.
Complete the code to call the method with the correct argument.
printNumber([1]);The method expects an integer argument, so passing 5 (an int) is correct.
Fix the error in the method declaration to accept two parameters: an integer and a string.
public void display([1] number, String text) { System.out.println(number + ": " + text); }
The first parameter should be int to accept an integer value.
Fill both blanks to declare a method that takes a double and a boolean parameter.
public void setValues([1] value, [2] flag) { System.out.println(value + ", " + flag); }
The method parameters are double for a decimal number and boolean for true/false values.
Fill all three blanks to declare a method that takes a String, an int, and a boolean parameter.
public void update([1] name, [2] age, [3] active) { System.out.println(name + ", " + age + ", " + active); }
The parameters are String for name, int for age, and boolean for active status.
