Instead of making Node class private in Linked list , we can make head as private , what is the purpose of making Node class private in this case ?
Why we need to make Node class private
We are making the Node class private so that no other person can create an instance of a Node class and use it from outside the class where it’s utility functions are defined. If we create the head node just private, still instance of Node class can be created from any class within that package.