Computer Applications
Parameters that are passed to the called method during the method call are termed as …………… parameters.
Answer
actual
Reason — Parameters that are passed to the called method during the method call are termed as actual parameters.
These are the real values provided as input to the method.
For example:
public void display(int x) {
System.out.println(x);
}
public static void main(String args[]) {
display(5); // Here, `5` is the actual parameter.
}
Related Questions
Define a class to overload the method generate() with the following variations:
void generate(int n, char ch) — Prints a pattern of n rows based on the value of
ch
:- If
ch
is'*'
, print a pattern of stars (*
).
n = 5
* * * * * * * * * * * * * * *
- If
ch
is'N'
, print a pattern of numbers.
n = 5
1 2 2 3 3 3 4 4 4 4 5 5 5 5 5
- For any other value of
ch
printInvalid Input
.
- If
double generate(int n) — Calculates and returns the sum of the following series:
1 - $\dfrac{1}{2}$ + $\dfrac{1}{3}$ - $\dfrac{1}{4}$ ….. to n termsdouble generate(double p, double q, double r) — Calculates and returns the value of z, where:
z = p2 + q2 - r2
public class KboatOverload { _______(1)_________ { if (ch != '*' && Character.toLowerCase(ch) != 'n') { System.out.println("Invalid Input"); } else { _______(2)_________ _______(3)_________ _______(4)_________ System.out.print("* "); } else { System.out.print(i + " "); } } System.out.println(); } } } double generate(int n) { int a = 1; double sum = 0; _______(5)_________ double t = _______(6)_________ t *= a; _______(7)_________ a *= -1; } return sum; } _______(8)_________ { double z = _______(9)_________ _______(10)_________ } }
Assertion (A): Static method can access static and instance variables.
Reason (R): Static variable can be accessed only by static method.
- Assertion and Reason both are correct.
- Assertion is true and Reason is false.
- Assertion is false and Reason is true.
- Assertion and Reason both are false.
Design a class to overload a function series( ) as follows:
(a) void series (int x, int n) – To display the sum of the series given below:
x1 + x2 + x3 + ………. xn terms
(b) void series (int p) – To display the following series:
0, 7, 26, 63 ………. p terms
(c) void series () – To display the sum of the series given below:
1/2 + 1/3 + 1/4 + ………. 1/10
Method which reverses a given number is:
- Impure method
- Pure method
- Constructor
- Destructor