Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribedimage text in transcribed

}

}

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 9 For Linux UNIX And Windows Advanced Database Administration Certification Certification Study Guide

Authors: Roger E. Sanders, Dwaine R Snow

1st Edition

1583470808, 978-1583470800

More Books

Students also viewed these Databases questions

Question

=+designing international assignment C&B packages.

Answered: 1 week ago