enum Fish {
GOLDFISH, ANGELFISH, GUPPY;
}
public class EnumTest2{
public static void main(String[] args){
Fish f = Fish.valueOf("GUPPY");
if (f == Fish.GUPPY)
System.out.println("Are equal");
if (f.equals(Fish.GUPPY))
System.out.println("Are equal");
}
}
Login in to like
Login in to comment