MCPcopy Create free account
hub / github.com/Rishabh062/Hacktoberfest2021 / ReverseString

Class ReverseString

Java/Reverse_string.java:11–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9// Class of ReverseString
10
11class ReverseString {
12
13 public static void main(String[] args)
14
15 {
16 Scanner sc= new Scanner(System.in);
17
18 System.out.print("Enter a string: ");
19
20 String input = sc.nextLine();
21
22 StringBuilder input1 = new StringBuilder();
23
24 // append a string into StringBuilder input1
25
26 input1.append(input);
27
28 // reverse StringBuilder input1
29
30 input1.reverse();
31
32 // print reversed String
33
34 System.out.println(input1);
35
36 }
37}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected