which of the following methods is recursive ? public static int length(String str) { if (str == null || str.equals("")) return 0: else return 1 + length(str.substring(1)); } public static int...



which of the following methods is recursive ?




























public static int length(String str) {


    if (str == null || str.equals(""))


       return 0:


  else


  return 1 + length(str.substring(1));


   }






public static int length(Strin str) {


    if (str == null || str.equals(""))


       return 0:


  else


  return 1;


   }






public static int length(Strin str) {


    if (str == null || str.equals(""))


  return 0:


     else


  return 1 + len(str.substring(1));


   }






public static int length(String str) {


    if (str == null || str.equals(""))


  return 0:


   }






java



Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here