Answer:
Following are the code to method calling
backwardsAlphabet(startingLetter); //calling method backwardsAlphabet
Output:
please find the attachment.
Step-by-step explanation:
Working of program:
- In the given java code, a class "RecursiveCalls" is declared, inside the class, a method that is "backwardsAlphabet" is defined, this method accepts a char parameter that is "currLetter".
- In this method a conditional statement is used, if the block it will check input parameter value is 'a', then it will print value, otherwise, it will go to else section in this block it will use the recursive function that prints it's before value.
- In the main method, first, we create the scanner class object then defined a char variable "startingLetter", in this we input from the user and pass its value into the method that is "backwardsAlphabet".