What is printed to the standard output if myMethod() is executed?
class MyPoint {
void myMethod() {
int x, y;
x = 5; y = 3;
System.out.print( " ( " + x + ", " + y + " ) " );
switchCoords( x, y );
System.out.print( " ( " + x + ", " + y + " ) " );
}
void switchCoords( int x, int y ) {
int temp;
temp = x;
x = y;
y = temp;
System.out.print( " ( " + x + ", " + y + " ) " );
}
}
Correct Answer: (5, 3) (3, 5) (5, 3)
Explanation:
Note: This Question is unanswered, help us to find answer for this one
More Java MCQ Questions