return an ArrayList method

This is a drive method for two other classes. which i posted here https://codereview.stackexchange.com/questions/33148/book-program-with-arraylist I need some help for the private static ArrayList getAuthors(String authors) method. I am kind a beginner. so please help me finish this drive method. or give me some directions. Instruction some of the elements of the allAuthors array contain asterisks …

Read more

ShoppingCart.Java Program Assignment

I am working on an assignment and I have run into a few problems. Here is the Assignment Question and what I’ve done so far and my question. Complete ShoppingCart.java as follows: Declare and instantiate a variable cart to be an empty ArrayList that can hold Product objects. Remember to import ArrayList. Comments in the …

Read more

ArrayList of int array in java

First of all, for initializing a container you cannot use a primitive type (i.e. int; you can use int[] but as you want just an array of integers, I see no use in that). Instead, you should use Integer, as follows: For adding elements, just use the add function: Last, but not least, for printing the ArrayList you may use the build-in functionality …

Read more