Page 1 :
Wednesday, June 09, 2021, 8:06 PM, , COMBINED ISC 135 Page 1
Page 8 :
Question 3., (a) 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);, }, }, , ) The following function witty() is a part of some class. What, will be the output of the function, witty() when the value of n is “SCIENCE” and the value of p, is 5. Show the dry run/ working:, class Trial1, {, public void witty(String n, int p), {, if(p<0), System.out.println(“”);, else, {, , COMBINED ISC 135 Page 8
Page 9 :
{, System.out.println(n.charAt(p)+”.”);, witty(n,p-1);, System.out.print(n.charAt(p));, }, }, }, , COMBINED ISC 135 Page 9