Advertisement
Telor_Goreng0

tugas pendahuluan

Apr 25th, 2021
21
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. package pertemuan4;
  2. import java.util.*;
  3. public class b {
  4. public static void main(String args[]){
  5. LinkedList<String> Link = new LinkedList<String>();
  6. Link.add("hitam");
  7. Link.add("merah");
  8. Link.add("biru");
  9. System.out.println("Macam Macam warna Pena :");
  10. for(int i=0;i<Link.size();i++){
  11. System.out.println((i+1)+". "+Link.get(i));
  12. }
  13. Link.remove(1);
  14. System.out.println("\nDaftar Setelah dihapus :");
  15. for(int i=0;i<Link.size();i++){
  16. System.out.println((i+1)+". "+Link.get(i));
  17. }
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement