Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a statement that calls the recursive method backwardsAlphabet() with param

ID: 3857962 • Letter: W

Question

Write a statement that calls the recursive method backwardsAlphabet() with parameter startingLetter. JAVA ONLY: please comment with only the 'your solution goes here' line! public class RecursiveCalls { public static void backwardsAlphabet(char currLetter) { if (currLetter == 'a') { System.out.println(currLetter); } else { System.out.print(currLetter + " "); backwardsAlphabet(--currLetter); } return; } public static void main (String [] args) { char startingLetter = '-'; startingLetter = 'z'; //Your solution goes here// return; } }

Explanation / Answer

"backwardsAlphabet(startingLetter);"

The above line would be sufficient if you just want pass a char value to the backwardsAlphabet method.

The other way you can do is

//here you are creating an object of the class named calls

RecursiveCalls calls = new RecursiveCalls();

//through the object you are passing the char value to the backwardsAlphabet method.

calls.backwardsAlphabet(startingLetter);

I hope this helps.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote