public
final boolean equals(Object other)
enum Day{ MON, TUE, WED, THU, FRI, SAT, SUN; public static void main(String args[]){ System.out.println("\tMON\tTUE\tWED\tTHU\tFRI\tSAT\tSUN"); for(Day d1 : Day.values()){ System.out.print(d1 +"\t"); for(Day d2 : Day.values()){ System.out.print(d1.equals(d2)+" \t"); } System.out.println(); } } }
Output
MON TUE WED THU FRI SAT SUN MON true false false false false false false TUE false true false false false false false WED false false true false false false false THU false false false true false false false FRI false false false false true false false SAT false false false false false true false SUN false false false false false false true
No comments:
Post a Comment