Created
June 17, 2015 08:20
-
-
Save mikeholmesuk/47d283b6fd679ad330dd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package my.classes.foo; | |
/** | |
* Created by mikeholmes on 17/06/15. | |
*/ | |
public class MyClassImpl implements IManager { | |
public String firstname; | |
public String lastname; | |
protected int age; | |
private int f; | |
private boolean why; | |
public MyClassImpl(String firstname) { | |
this.firstname = firstname; | |
} | |
public MyClassImpl(String lastname, String firstname) { | |
this.firstname = firstname; | |
this.lastname = lastname; | |
} | |
public MyClassImpl(String firstname, int age, String lastname) { | |
this.firstname = firstname; | |
this.lastname = lastname; | |
this.age = age; | |
} | |
/** | |
* | |
* @return | |
*/ | |
public String getFirstname() { | |
return this.firstname; | |
} | |
public void setFirstname(String firstname) { | |
this.firstname = firstname; | |
} | |
public void changeAge(int age) { | |
this.age = age; | |
} | |
/** | |
* | |
* @param years | |
* @return | |
*/ | |
public boolean addYearToAge(int years) { | |
this.age += years; | |
return true; | |
} | |
public void setF(int g) { | |
this.f = g; | |
why = true; | |
} | |
/** | |
* | |
* @param newMarriedSurname | |
* @param dateOfBirth | |
*/ | |
public void getMarriedOnBirthday(String newMarriedSurname) { | |
this.lastname = newMarriedSurname; | |
} | |
public void doThingAndAddAgeOrAbbreviateFirstname(int age) { | |
ManagerClass m = new ManagerClass(); | |
if (age < 10) { | |
firstname = firstname.substring(0, 3); | |
} | |
else { | |
this.age = m.otherThing(age); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment