
public class Person{
private String lastname;
private String firstname;
private int age;
private boolean married;
public float salary;
public static final int MALE= 0;
public static final int FEMALE= 1;
public int sex;

public Person(String lastname, String firstname, int age, boolean married, float salary, int sex){
this.lastname=new String(lastname);
this.firstname=new String(firstname);
this.age= age;
this.married=married;
this.salary=salary;
this.sex= sex;
}

void printInfo(){
System.out.print(firstname+" "+ lastname + " is "+ age+ " years old, gets a "+salary+" Euros salary is a ");
if(sex==0) System.out.print("male");
else System.out.print("female");
System.out.print(" and is ");
if(married==false)
System.out.print("not ");
System.out.println("married ");
}
public String getLastName(){ return lastname;}
public String setLastName(String last){lastname=new String(last); return lastname;}
public String getFirstName(){return firstname;}
public String setFirstName(String first){return firstname=first;}
public int getAge() {return age;}
public int setAge(int hlikia){return age=hlikia;}
public boolean isMarried(){ return married;}
public boolean setMarried(boolean mar){return married=mar;} 
public float getSalary() {return salary;}
public float setSalary(float money){return salary=money;}
}
