Guest User

Untitled

a guest
Dec 14th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. public static void main(String[] args) {
  2. // write your code here
  3. ArrayList<String>line1=new ArrayList<String>();
  4. line1.add("el marg");
  5. line1.add("ezbt el nakhl");
  6. line1.add("ain shams");
  7. line1.add("el matria");
  8. line1.add("el helmia");
  9. Scanner s=new Scanner(System.in);
  10. System.out.println("Entry Station");
  11. String answer1=s.next();
  12. Scanner a=new Scanner(System.in);
  13. System.out.println("Exit Station");
  14. String answer2=a.next();
  15.  
  16. System.out.println(line1.subList(line1.indexOf(answer1),line1.indexOf(answer2)));
  17. }
  18. }
Add Comment
Please, Sign In to add comment