mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-10-11 16:13:01 +00:00
Added comments in the code. modified index.md
This commit is contained in:
1 parent
083065ba93
commit
d3eb8a2ef2
4 files changed
+48
-10
No files matched your search
@@ -1,12 +1,19 @@
|
||||
package com.iluwatar.value.object;
|
||||
|
||||
/**
|
||||
* Hello world!.
|
||||
* App Class.
|
||||
*
|
||||
*/
|
||||
public class App {
|
||||
/**
|
||||
* main method.
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
HeroStat stat = HeroStat.valueOf(10, 5, 0);
|
||||
System.out.println(stat.toString());
|
||||
HeroStat statA = HeroStat.valueOf(10, 5, 0);
|
||||
HeroStat statB = HeroStat.valueOf(5, 1, 8);
|
||||
|
||||
System.out.println(statA.toString());
|
||||
// When using Value Objects do not use ==, only compare using equals().
|
||||
System.out.println("is statA and statB equal : " + statA.equals(statB));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user