What is the difference between both types of instatiation of inner static class

There are no difference between these statements:

  1. PC pc = new PC()
  2. ProducerConsumer.PC pc1 = new ProducerConsumer.PC();

You can use both variants. Moreover, you can use variant 1 in other class, but in that case you have to add static import to the ProducerConsumer.

NO DIFFERENCE.

Leave a Comment