I called the removeAll method to remove from my tempDictionary but it removes from d. So how can I avoid privacy leak and assign new refrence to tempDictionary.
public static void play1(Dictionary d, int level )throws IOException
{
Dictionary tempDictionary = d ;
tempDictionary.removeAll();
}
//after looking to the link doesn't compile I tried to do exact same
class Dictionary {
private Dictionary dictionary; public Dictionary(Dictionary temp ) {
this.dictionary = temp.dictionary; // error
}
}