Adding null values to arraylist?

Can I add null values to an ArrayList even if it has a generic type parameter? Eg. ArrayList<Item> itemList ...

Creating a student arraylist to add students to course class Java?

Im trying to create a student arraylist to a a course class so that when a student is added the arraylist is increas...

Basic Bubble Sort with ArrayList in Java?

I was implementing a comparator, and it wasn't working, so I thought I'd write a basic bubble sort. int[] numbers =...

Return ArrayList from ArrayList method type?

I'm making a little card deck program that uses an ArrayList for the deck. One of the limitations set upon me is th...

2D array class in java with wrap around edges?

I am making a 2D array class in Java with wrap around edges. So in an 10x20 array, entry (2,-1) would be the same as...

How to create a Multidimensional ArrayList in Java??

I'm fairly new to ArrayLists anyway but I need them for this project I'm doing so if you guys could help me I would ...

How do I declare a 2D String arraylist??

I want to do something like this ArrayList<String<String>> mylist How can I create it? How can I add t...

How to do sorting in array list without using collections in Java?

ArrayList < Integer > arraylist = new ArrayList < Integer > (); arraylist.add(10010); arraylist.add(5);...

Storing and Retrieving ArrayList values from hashmap?

I have a hashmap of the following type HashMap<String,ArrayList<Integer>> map=new HashMap<String,Ar...

Why toString() method works differently between Array and ArrayList object in Java?

String[] array = {"a","c","b"}; ArrayList<String> list = new ArrayList<String>(); list.add("...

Passing ArrayList as a parameter?

Let me start by saying that I can't put any code here because Internet on my laptop is not working so I am posting t...

Moving ArrayList element to the last position in the List??

In the following method I have an ArrayList of Strings. I check if any of these strings are in a txt file (checkIf...

“Exception in thread ”main“ java.lang.IndexOutOfBoundsException: Index: 0, Size: 0” with ArrayList??

"Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0" is the main error I get when I c...