Question: 14 The method below generates all substrings of a String passed as argument. Assuming that the string contains no duplicate characters, select the statement to

14 The method below generates all substrings of a String passed as argument. Assuming that the string contains no duplicate characters, select the statement to complete the method so that it prints all substrings correctly. public static void printSubstrings (String word) { } if (word.length() > 0) ( } for (int j = 1; j <- word.length(); j++) // print substrings that begin with the first character { 4 } System.out.println (word.substring(0, 1)); // print substrings without the first character O printSubstrings (word.substring(0)); OprintSubstrings (word.substring(1)); O printSubstrings (word.substring(word.length())); O printSubstrings (word.substring(word.length() - 1)); 6 pts

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!