Who will take the role of Friend functions in java as in C++?
java
Solution
The closest thing Java has to C++ friends is the default access modifier, also known as package-protected or package-private. This allows access to members only from other classes within the same package.
This is also the best reason to place classes in the same package, rather than grouping into subpackages based on functionality.
Problem
Who will take the role of Friend functions in java as in C++? How will it work in java ? Thanks..