Examine the following code: Which of the following correctly creates an instance of both the Product and the ProductDetail (a non-static inner) class?

a) ProductDetail pd = new Product.ProductDetail();
b) Product pd = new Product();
c) ProductDetail pd = new Product().new ProductDetail();
d) Product.ProductDetail pd = new Product().ProductDetail();

Q&A Education