File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change
1
+ package easy ;
2
+
3
+ /**
4
+ * Have the function FirstReverse(str) take the str parameter
5
+ * being passed and return the string in reversed order.
6
+ * For example: if the input string is "Hello World and Coders"
7
+ * then your program should return the string sredoC dna dlroW olleH.
8
+ */
9
+ public class FirstReverse {
10
+
11
+ /**
12
+ * First Reverse function.
13
+ *
14
+ * @param str input string
15
+ * @return reversed string
16
+ */
17
+ private static String firstReverse (String str ) {
18
+ return new StringBuilder (str ).reverse ().toString ();
19
+ }
20
+
21
+ /**
22
+ * Entry point.
23
+ *
24
+ * @param args command line arguments
25
+ */
26
+ public static void main (String [] args ) {
27
+ var result1 = firstReverse ("Hello World and Coders" );
28
+ System .out .println (result1 );
29
+ var result2 = firstReverse ("Good Looking Blues" );
30
+ System .out .println (result2 );
31
+ }
32
+
33
+ }
You can’t perform that action at this time.
0 commit comments