Please Use your keyboard (Don't use handwriting) Thank you..
I need new and unique answers, please. (Use your own words, don't copy and paste)
Write a Java program that:
Important notes:
Enter your first name and ID: Maha 1400586001 Your first name and ID in reverse order: 1006850041 ahaM |
The following are examples of the output:
//ReverseStringRec.java import java.util.Scanner; public class ReverseStringRec { public static void printReverse(String s){ if(s.length()!=0){ printReverse(s.substring(1)); System.out.print(s.charAt(0)); } } public static void main(String[] args) { Scanner scan = new Scanner(System.in); System.out.println("Enter your first name and ID:"); String s = scan.nextLine(); System.out.println("Your first name and ID in reverse order:"); printReverse(s); System.out.println(); } }
Get Answers For Free
Most questions answered within 1 hours.