I am attempting to write code to traverse a collection of type InstallationComponentSetup
:
java.util.Collection<InstallationComponentSetup> components= context.getInstallationComponents();
Iterator it = components.iterator();
while (it.hasNext())
{
if (((InstallationComponentSetup)it).getName() == "ACQ")
{
return true;
}
}
The cast in the if
-statement fails, but I don't really know why (I am a C++ programmer!).
If someone could give me some pointers as to what I am doing wrong I would be grateful.