Computer Applications
State whether the following statement is True or False :
A method body is enclosed within curly brackets.
Related Questions
State whether the following statement is True or False :
Overloading of methods even depends on return type.
State whether the following statement is True or False :
A method cannot be defined without parameters.
Give output of the following method definition and also write the mathematical operation they carry out:
void test1(int n) { for(int x=1; x<=< span>n; x++) if(n%x == 0) System. out.println(x); } =<>
if 12 is passed to n.
Give output of the following method definition and also write the mathematical operation they carry out:
void test2(int a, int b) { while( a != b) { if ( a > b) a = a — b; else a = b — a; } System.out.println(a); }
if 4 and 17 are passed to the function.