Commit 2da1413

mo <mo.khan@gmail.com>
2019-05-27 03:01:15
loop through list of sentences
1 parent 0aaf949
Changed files (1)
src/Q1/ReversedSentence.java
@@ -1,5 +1,8 @@
 package Q1;
 
+import java.util.ArrayList;
+import java.util.Scanner;
+
 public class ReversedSentence {
   public static String change5thPosition(String s) {
     return "";
@@ -21,5 +24,14 @@ public class ReversedSentence {
     return "";
   }
 
-  public static void main(String[] args) {}
+  public static void main(String[] args) {
+    Scanner in = new Scanner(System.in);
+    ArrayList<String> sentences = new ArrayList<String>();
+
+    for (int i = 0; i < 3; i++) {
+      System.out.print("Enter sentence: ");
+      String sentence = in.next();
+      sentences.add(sentence);
+    }
+  }
 }