Advertisement
Guest User

Untitled

a guest
Jan 25th, 2020
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.28 KB | None | 0 0
  1. import java.util.ArrayList;
  2. import java.util.List;
  3.  
  4. public class Main {
  5.     public static void main(String[] args) {
  6.         System.out.println("test");
  7.         List<String> exampleList = new ArrayList<>();
  8.         System.out.println(exampleList);
  9.         exampleList.add("Pizza");
  10.         exampleList.add("Lobster bisque");
  11.         exampleList.add("STEAK & STEAMED LOBSTER TAIL");
  12.         exampleList.add("Our signature steak paired with a steamed lobster tail.");
  13.         exampleList.add("STEAK WITH CRISPY LOBSTER & SHRIMP");
  14.         exampleList.add("Our twist on the classic steak and lobster.");
  15.         exampleList.add("Succulent hand-breaded lobster and shrimp,");
  16.         exampleList.add("fried golden brown and paired with a homemade sweet and spicy sauce.");
  17.         System.out.println(exampleList);
  18.  
  19.         exampleList.remove(1);
  20.         System.out.println();
  21.         System.out.println("Removing the second item");
  22.         System.out.println(exampleList);
  23.         System.out.println();
  24.         System.out.println("Removing the String Pizza");
  25.         System.out.println();
  26.         exampleList.remove("Pizza");
  27.         System.out.println(exampleList);
  28.  
  29.         for (String food : exampleList) {
  30.             System.out.println("I want to try "+ food);
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement