+ 1
How to write a specification in the constructor Java?
Enum values in color are written in capital letters (BLACK, WHITE). Itâs necessary to make a refinement to the class, so that in the console turn out âwhitEâ, âblackâ
1 Answer
+ 1
// I hope this link helps you
https://code.sololearn.com/ctzBXfgRTAZU
String w = Color.WHITE.name();
System.out.println(
w.toLowerCase().substring(0,w.length()-1) +
w.substring(w.length()-1, w.length()) );
String b = Color.BLACK.name();
System.out.println(b.toLowerCase());