Advertisement
Guest User

Untitled

a guest
Mar 5th, 2016
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. public class Listok {
  2.  
  3. public static void main(String[] args) {
  4. String [] s = {"Suka","Pidar","Zalupa","Huy"};
  5. List <String> list = new ArrayList<String>(Arrays.asList(s));
  6.  
  7. Scanner scn = new Scanner(System.in);
  8. while(true){
  9. String s1 = scn.nextLine();
  10.  
  11. if(list.contains(s1)){
  12. System.out.println("Есть такое");
  13. list.remove(s1);
  14. }else if(s1.equals("exit")){
  15. break;
  16. }else{
  17. System.out.println("Нет такого");
  18. }
  19. }
  20. }
  21.  
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement