Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ClassOfStaticMethods {
- public static int trexonAM = 14014;
- public static void findMaxSalary(Ypallhlos yp1, Ypallhlos yp2) {
- System.out.println("\nΥπάλληλος με τον μεγαλύτερο μισθό: ");
- if (yp1.gettelikosMisthos() > yp2.gettelikosMisthos())
- System.out.println(yp1);
- else
- System.out.println(yp2);
- }
- public static Ypallhlos findMaxSalaryAll(Ypallhlos yp[]) {
- Ypallhlos maxYp = yp[0];
- for (int i = 1; i < yp.length; i++) {
- if (maxYp.gettelikosMisthos() < yp[i].gettelikosMisthos())
- maxYp = yp[i];
- }
- return maxYp;
- }
- public static void setTelikosMisthosAll(Ypallhlos yp[]) {
- for (Ypallhlos i: yp)
- i.settelikosMisthos();
- /*for(int i = 0; i < yp.length; i++)
- yp[i].settelikosMisthos();*/
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement