fubarable

generic example

Feb 8th, 2021
723
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.29 KB | None | 0 0
  1. import java.util.*;
  2.  
  3. public class TimerTest {
  4.     public static void main(String[] args) {
  5.         ArrayList someList = new ArrayList();
  6.        
  7.         ArrayList<Integer> intList = someList;
  8.         intList.add(20);
  9.         System.out.println(intList);
  10.        
  11.         someList.add("foo");
  12.        
  13.         System.out.println(intList);
  14.     }
  15. }
  16.  
Add Comment
Please, Sign In to add comment