Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.ArrayList;
- import java.util.List;
- public class ArrayTest {
- public static void main(String[] args) {
- int[] test1 = {1, 2, 3};
- List<Integer> test2 = new ArrayList<>(3);
- test2.add(1);
- test2.add(2);
- test2.add(3);
- Integer[] test3 = new Integer[3];
- test2.toArray(test3);
- System.out.print("test1 = ");
- System.out.println(test1);
- System.out.print("test2 = ");
- System.out.println(test2);
- System.out.print("test3 = ");
- System.out.println(test3);
- }
- }
- /* Output:
- test1 = [I@2a139a55
- test2 = [1, 2, 3]
- test3 = [Ljava.lang.Integer;@15db9742
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement