Is there a way to simulate the C++ ‘friend’ concept in Java?
Here is a small trick that I use in JAVA to replicate C++ friend mechanism. Lets say I have a class Romeo and another class Juliet. They are in different packages (family) for hatred reasons. Romeo wants to cuddle Juliet and Juliet wants to only let Romeo cuddle her. In C++, Juliet would declare Romeo … Read more