Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) {
- // write your code here
- ArrayList<String>line1=new ArrayList<String>();
- line1.add("el marg");
- line1.add("ezbt el nakhl");
- line1.add("ain shams");
- line1.add("el matria");
- line1.add("el helmia");
- Scanner s=new Scanner(System.in);
- System.out.println("Entry Station");
- String answer1=s.next();
- Scanner a=new Scanner(System.in);
- System.out.println("Exit Station");
- String answer2=a.next();
- System.out.println(line1.subList(line1.indexOf(answer1),line1.indexOf(answer2)));
- }
- }
Add Comment
Please, Sign In to add comment