205k views
4 votes
You should fill in the blank in the following code with ______________.public class Test {public static void main(String[] args) {System.out.print("The grade is ");printGrade(78.5);System.out.print("The grade is ");printGrade(59.5);}public static __________ printGrade(double score) {if (score >= 90.0) {System.out.println('A');}else if (score >= 80.0) {System.out.println('B');}else if (score >= 70.0) {System.out.println('C');}else if (score >= 60.0) {System.out.println('D');}else {System.out.println('F');}}}A. int. B. double.C. boolean.D. char.E. void.

User Hok
by
6.3k points

1 Answer

4 votes

Answer:

E. void.

Step-by-step explanation:

In the Java code given in the question the method is printing the statements it is not returning anything.So the return type of this method is void.There are only print statement in every if and in every else if or else not a single variable is returned in this method the method ended after the else statement.

User Andro
by
5.8k points