Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- class Main {
- public static void main(String args[])
- {
- Scanner src=new Scanner(System.in);
- System.out.println("Enter number of strings");
- int n=src.nextInt();
- ArrayList<String> one=new ArrayList<String>();
- for(int i=0;i<n;i++)
- {
- System.out.println("Enter the string");
- one.add(src.next());
- }
- System.out.println(one);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement