Generic6.java - \/Purpose Practicing with Generics Recursion and Interfaces\/Author Misty Van Dyke Miguel Vazquez\/Course CS 1302\/Date\/Program

Generic6.java - /Purpose Practicing with Generics...

This preview shows page 1 out of 1 page.

//******************************************************************************* //Purpose: Practicing with Generics, Recursion, and Interfaces // //Author: Misty Van Dyke, Miguel Vazquez // //Course: CS 1302 //Date: 3/20/2019 //Program: Generic6.java //******************************************************************************* import java.util.ArrayList; public class Generic6{ //No argument constructor// public Generics6(){ //Recieves a one dimensional array and returns the maximum value// public <E extends Comparable<E>> E max(E[] list){ E max = list[0]; for(int i = 1; i < list.length; i++){ E el = list[i]; if(el.compareTo(max >0){ max = el; } } return max;
Image of page 1

You've reached the end of your free preview.

Want to read the whole page?

  • Fall '08
  • STAFF
  • The Key, E max, Misty Van Dyke, public class Generic6

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture