216k views
1 vote
Which of the following is a correct call to a method declared as public static void i) aMethod(char code)? a. void aMethod(); b. void aMethod(‘V’); c. aMethod(char ‘M’); d. aMethod(‘Q’);

User Nixmind
by
5.4k points

1 Answer

4 votes

Answer:

Option(d) i.e aMethod(‘Q’); is the correct answer for the given question .

Step-by-step explanation:

To call any method following syntax is used

methodname(parameter);

In option(a) the return type void is used and no char parameter is passed in the function so this option is wrong.

In option(b) the return type void is used which is not correct syntax to calling a method so this option is wrong.

In option(c) the char datatype is passed in the function which is not correct syntax to calling a method so this option is wrong.

So aMethod(‘Q’); is the correct answer .