public class Product { int id; String name; public Product(int id, String name) { this.id = id; this.name = name; } }
4.Product pi = new Product(101, "Pen") ; 5.Product p2 = new Product(101, "Pen"); 6.Product p3 = pi; 7.boolean ans1 = pi == p2; 8.boolean ans2 = pi.name.equals (p2.name); 9.System.out.print(ans1 +":"+ ans2);