Question: This is a java program that runs on the Eclipse. } } Java Programming 2-4: Collections Part 1 Practice Activities Lesson objectives: Create a collection

This is a java program that runs on the Eclipse.

This is a java program that runs on the Eclipse. } }Java Programming 2-4: Collections Part 1 Practice Activities Lesson objectives: Create a

}

}

Java Programming 2-4: Collections Part 1 Practice Activities Lesson objectives: Create a collection without using generics Create a collection using generics Implement an ArrayList Implement a set Vocabulary: Identify the vocabulary word for each definition below. A set similar to an ArrayList without any specific ordering. An ordered Collection that may contain duplicates. An interface used to define a group of objects. This includes lists and sets. A list that is very similar to an array. A Collection of elements that does not contain any duplicates. Try lt/Solve It 1. What is the difference between a set and a list? 2. You decide you want to roll 2 dice and see what the frequency is of each possible number combination. Would you use a Set collection to do this? State your reason (s) 3. Using a collection create a variable that will store a list of countries (Strings). Your collection should not store duplicates, and order is not important. Test your code by adding 6 countries, one of which is a duplicate. 4. Would the following Collection.sort0 statements both work? Explain your answer. HashSet countries Set new Hashset String> Collections. sort (countriesSet); Array List countr List new Array List Collections sort (countriesList)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!