Oracle 1Z0-808 Exam question no. 65

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.

Post a Comment

2 Comments