Skip to content

michaelwomack/generics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Assignment2

The purpose of this assignment is to reinforce generics concepts. Specifically, the assigment is to the following 3 problems.

  1. Write a generic method that returns an arraylist containing the distinct elements of the given arraylist. The method header should be public static <E extends Comparable> ArrayList distinct (ArrayList list)

  2. Write a generic method that shuffles the elements of an arraylist. Do not use the shuffle method in the Java library. The method header should be public static void shuffle (ArrayList list)

  3. Write a generic method that returns the largest element in an arraylist. The method header should be public static <E extends Comparable> E max (ArrayList list)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages