Computer Science, asked by babumoshai084, 1 month ago

Make a class and send hello to your friend. in java ​

Answers

Answered by mayanksaha9125
1

Answer:

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 as a (lover) friend but there are no such things in java.

Here are the classes and the trick :

Ladies first :

Similar questions