Skip to content

Commit 107b367

Browse files
author
Paulo Henrique Ortolan
committed
Getting the class name for the infered type with new members
1 parent 8ca9993 commit 107b367

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/main/java/org/java10/examples/ProductExample.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@ public float applyInternetPrice() {
1515
System.out.println(modifiedProduct.calculateTotal());
1616
System.out.println(modifiedProduct.applyDiscount(0.15f));
1717
System.out.println(modifiedProduct.applyInternetPrice());
18+
System.out.println(modifiedProduct.getClass());
1819
System.out.println("----------------");
1920

2021
var commonProduct = new Product("A not internet product", 8f, 0.5f);
2122

2223
System.out.println("Common product");
2324
System.out.println(commonProduct.calculateTotal());
2425
System.out.println(commonProduct.applyDiscount(0.15f));
26+
System.out.println(commonProduct.getClass());
2527
System.out.println("--------------");
2628
}
2729

0 commit comments

Comments
 (0)