I have a hashtable created:
Hashtable next_hop = new Hashtable();
I insert values like next_hop.put("R1","local") and so on...
The hashtable looks like this:
{R5=R5, R4=R2, R3=R2, R2=R2, R1=Local}
Now I try to retrieve the values from the keys as follows:
String endPoint = "R1";
for (Object o: next_hop.entrySet()) {
Map.Entry entry = (Map.Entry) o;
if(entry.getKey().equals(endPoint)){
String nextHopInt = entry.getValue();
}
}
i get the following error:
error: incompatible types
String nextHopInt = entry.getValue();
required: String
found: Object