Created
May 13, 2019 09:46
-
-
Save Morzanne/a8dd552ecd1340f18ad8bc5ff376d3d3 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
public class Classroom{ | |
public static void main(String[] args){ | |
Wilder Aurelien = new Wilder("Aurelien", false); | |
System.out.println(Aurelien.whoAmI()); | |
System.out.println("Je m'apelle "+Aurelien.getFirstName()+" et je suis aware: "+Aurelien.isAware()); | |
Aurelien.setFirstName("Patrice"); | |
Aurelien.setAware(true); | |
System.out.println("Je m'apelle "+Aurelien.getFirstName()+" et je suis aware: "+Aurelien.isAware()); | |
System.out.println(Aurelien.whoAmI()); | |
} | |
} |
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
public class Wilder{ | |
private String firstName; | |
private boolean aware; | |
public Wilder(String firstName, boolean aware){ | |
this.firstName = firstName; | |
this.aware = aware; | |
} | |
public String getFirstName(){ | |
return this.firstName; | |
} | |
public boolean isAware(){ | |
return this.aware; | |
} | |
public void setFirstName(String firstName){ | |
this.firstName = firstName; | |
} | |
public void setAware(boolean aware){ | |
this.aware = aware; | |
} | |
public String whoAmI(){ | |
if(this.aware == false){ | |
return ("Je m'appelle " +this.firstName+ " et je ne suis pas aware"); | |
}else{ | |
return ("Je m'appelle " +this.firstName+ " et je suis aware"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment