Added comments in the code. modified index.md
This commit is contained in:
@ -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