- # (hash)
ABC YES Js
- Cannot call private method outside the class.
- Create memory inefficiency when different objects are created for the same class, as a new copy of the method would be created for each instance.
Example: If we call a private member function outside the class, then in that case it gives an error.
But below example gives the correct output:
Example: If we create a different object for the same class, then in that case each object creates its own instance or say a copy of the function for itself. Then in that case memory inefficiency problem arises
90000 51000 54000
Note: The code here mentioned can be run using inside HTML or a console.