PR2/PR2_UIB/Exercises/Testat1/Aufgabe1/Person.java

21 lines
389 B
Java

package Testat1.Aufgabe1;
public class Person {
protected String name;
protected int age;
protected double salary;
protected int id;
private static int increment = 1;
public Person(String name, int age, double salary) {
this.name = name;
this.age = age;
this.salary = salary;
this.id = increment++;
}
public double calculateYearlyIncome() {
return salary * 12;
}
}