Computer Applications
Which of the following is the CORRECT statement to invoke the method with the prototype int display(int a, char ch)?
- int m = display('A', 45);
- int m = display( );
- int m = display(A,45);
- int m = display(45,'A');
User Defined Methods
1 Like
Answer
int m = display(45,'A');
Reason — The method display expects two parameters: the first is an int and the second is a char. Among the options, only display(45, 'A') passes the arguments in the correct order and with the correct types—45 as an integer and 'A' as a character literal.
Answered By
2 Likes
Related Questions
Parameters which receive the values from the called method are termed as …………… parameters.
- actual
- formal
- reference
- class
Which of the following is a valid method prototype?
- public int perform (int a;int b)
- public perform (int a, int b)
- public int perform (int a, int b)
- public perform int (int a, int b)
Which of the following is the CORRECT java statement to convert the word RESPECT to lowercase?
- "RESPECT".tolowercase( );
- "RESPECT".toLowerCase( );
- toLowerCase("RESPECT");
- String.toLowerCase("RESPECT");
Which of the following are Wrapper classes?
(i) Boolean
(ii) boolean
(iii) character
(iv) Character- (i) and (iv)
- (ii) and (iv)
- (i) and (iii)
- (ii) and (iii)