1.

The following is a part of some class. What will be the output of the function mymethod( ) when the value of the counter is equal to 3? Show the dry run/working.void mymethod (int counter){ if (counter == 0) System.out. println(” "); else { System.out.println ("Hello" +counter); mymethod (--counter); System.out.println (" " +counter); } }

Answer»
counter output
3Hello 3
2Hello 2
1Hello 1



Discussion

No Comment Found

Related InterviewSolutions