Correct the methods code - system out


QUESTION #1:

Correct the following method's code (it has an error in it):

public void printSum( int a, int b ){
int sum = a + b;
System.out.println( "Sum is: " + sum );
return sum;
}

QUESTION #2:

Correct the following code (it has an error in it):

public void printCount( int a, int b ){
for( int i = 0; i < b; i + 1 ){
System.out.println( a + i );
}
}

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Correct the methods code - system out
Reference No:- TGS02381154

Now Priced at $5 (50% Discount)

Recommended (92%)

Rated (4.4/5)