Ask Question
2 December, 06:42

Write the definition of a method printGrade, which has a char parameter and returns nothing. The method prints on a line by itself the message string Grade: followed by the char parameter (printed as a character) to standard output. Don't forget to put a new line character at the end of your line.

+2
Answers (1)
  1. 2 December, 07:50
    0
    The answer to this question can be given as:

    Method Definition:

    void printGrade (char x) / /declare method with parameter.

    {

    //method body

    System. out. println ("Grade: "+x);

    //print value in new line.

    }

    Explanation:

    In the above method definition, we define a method that's name is already given in the question that is printGrade. This method does not return any value because its return type is void. In this method, we pass a char variable as a parameter. Then we define the method body in the method body we print the value of the char variable in the new line. To print the value in the new line we use the println function in java.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Write the definition of a method printGrade, which has a char parameter and returns nothing. The method prints on a line by itself the ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers