Advertisement
Guest User

ClassOfStaticMethods

a guest
May 21st, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.79 KB | None | 0 0
  1. public class ClassOfStaticMethods {
  2.     public static int trexonAM = 14014;
  3.  
  4.     public static void findMaxSalary(Ypallhlos yp1, Ypallhlos yp2) {
  5.         System.out.println("\nΥπάλληλος με τον μεγαλύτερο μισθό: ");
  6.         if (yp1.gettelikosMisthos() > yp2.gettelikosMisthos())
  7.             System.out.println(yp1);
  8.         else
  9.             System.out.println(yp2);
  10.     }
  11.  
  12.     public static Ypallhlos findMaxSalaryAll(Ypallhlos yp[]) {
  13.         Ypallhlos maxYp = yp[0];
  14.         for (int i = 1; i < yp.length; i++) {
  15.             if (maxYp.gettelikosMisthos() < yp[i].gettelikosMisthos())
  16.                 maxYp = yp[i];
  17.         }
  18.         return maxYp;
  19.     }
  20.    
  21.     public static void setTelikosMisthosAll(Ypallhlos yp[]) {
  22.         for (Ypallhlos i: yp)
  23.             i.settelikosMisthos();
  24.        
  25.         /*for(int i = 0; i < yp.length; i++)
  26.             yp[i].settelikosMisthos();*/
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement