Q. - Given:
class Cart {
Product p;
double totalAmount;
}
class Product {
String name;
Double price;
}
public class Shop {
public static void main(String[] args) {
Cart c = new Cart ( );
System.out.println(c.p + ":" + c. totalAmount);
}
}
What is the result?
A) <hashcode> : 0.0
B) null : null : 0.0
C) null : null
D) null : 0.0
⧪ please give your answer in a comment section.
class Cart {
Product p;
double totalAmount;
}
class Product {
String name;
Double price;
}
public class Shop {
public static void main(String[] args) {
Cart c = new Cart ( );
System.out.println(c.p + ":" + c. totalAmount);
}
}
What is the result?
A) <hashcode
2 Comments
a
ReplyDeleteD
ReplyDelete