MCQs > IT & Programming > JSharp - J# > What will be the output when myMethod() is executed?

JSharp - J# MCQs

What will be the output when 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 + " ) " );
  }
}

Answer

Correct Answer: (5, 3) (3, 5) (5, 3)

Explanation:

Note: This Question is unanswered, help us to find answer for this one

JSharp - J# Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

JSharp - J# Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it