This file contains hidden or 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 UglyObject | |
| { | |
| private int a; | |
| private int b; | |
| public UglyObject(int a, int b) | |
| { | |
| this.a = a; | |
| this.b = b; | |
| } |
This file contains hidden or 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 interface Pretty | |
| { | |
| int getNumber(); | |
| } |
This file contains hidden or 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 PrettyObject | |
| implements Pretty | |
| { | |
| private final int a; | |
| private final int b; | |
| public PrettyObject(int a, int b) | |
| { | |
| this.a = a; | |
| this.b = b; |
This file contains hidden or 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 UglyClass | |
| { | |
| private int number; | |
| public UglyClass(int number) | |
| { | |
| this.number = number; | |
| } | |
| public int getNumber() |
This file contains hidden or 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
| class Logic | |
| { | |
| void update() | |
| { | |
| view.show(data.get()); | |
| } | |
| void update(Pretty p) | |
| { | |
| data.set(p); | |
| update(); |
This file contains hidden or 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 UglyClass | |
| { | |
| private int number; | |
| private String name; | |
| private Date date; | |
| public int getNumber() | |
| { | |
| return number; | |
| } |
This file contains hidden or 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 UglyClass | |
| { | |
| public int number; | |
| public String name; | |
| public Date date; | |
| } |
This file contains hidden or 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
| UglyClass ugly = new UglyClass(); | |
| ugly.setDate(new Date()); | |
| Date date = ugly.getDate(); | |
| UglyClass ugly = new UglyClass(); | |
| ugly.date = new Date(); | |
| Date date = ugly.date; |
This file contains hidden or 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
| class UglyClass | |
| { | |
| var number: Int = 0 | |
| var name: String? = null | |
| var date: Date? = null | |
| } |
This file contains hidden or 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
| private boolean numberIsNegative = false; | |
| public void setNumber(int number) | |
| { | |
| this.number = number; | |
| numberIsNegative = number < 0; | |
| } |
OlderNewer