Menu

(Solved) : Please Complete Following Java Code See Main Function Details Code Thanks Public Class Ne Q44001626 . . .

Please complete the following java code, see the main functionfor details on what code should do. Thanks!

public class newAssign {

static <U> U minVal(Iterable<U> l,Comparator<U> c){
   // write using fold. No other loops permitted.
   return null;
}

static <U extends Comparable<U>> intminPos(Iterable<U> l){
   // write using fold. No other loops permitted.
   return 0;
}

   public static void main(String[] args) {
      
       // (1) Use minVal to calculate theminimum of a List of
       // Integers
      
// (6) Use minVal to calculate the maximum of a List of
       // Integers
      
       // (2) Use minPos to calculate theposition of the
       // minimum in a List ofIntegers

       // (3) Use minPos to calculatethe position of the
       // maximum in a List ofString
   }

}

class Person{
   final int salary;
   final String name;
  
   Person(int salary, String name){
       this.salary = salary;
       this.name = name;
   }
  
   int getSalary() { return salary; }
   String name() { return name;}
  
}

Expert Answer


Answer to Please complete the following java code, see the main function for details on what code should do. Thanks! public class …

OR