Introduction to java -- Enumeration
Introduction to java -- Enumeration
concept
enumeration is a new feature introduced in JDK 1.5
grammar
public enum Color{
//Add public static final Color by default
RED,GREEN,BLUE;
}
essence
Enumeration is a restricted class and has its own methods. When you create your own enum class, this class inherits from Java lang.Enum ...
Added by dotwebbie on Thu, 30 Dec 2021 05:50:51 +0200
Shang Silicon Valley_ Java zero foundation tutorial (common classes -- Enum classes) -- learning notes
1, Enum
I Use of enumeration classes
Understanding of enumerating classes: there are only a limited number of objects in a class. For sure, we call this class enumerating classEnumeration classes are strongly recommended when you need to define a set of constantsIf there is only one object in the enumeration class, it can be used as an im ...
Added by mhalloran on Sat, 18 Dec 2021 08:24:40 +0200
Java interview questions ~ switch case optimization based on annotation + Enum + strategy mode
Abstract: in this article, we will continue to share and introduce the second "code optimization question" about Java interview. The main functions are: Based on the idea of "annotation + Enum enumeration + policy mode" based on Spring Boot, we often need to increase or decrease the judgment of if else or the value of consta ...
Added by drbigfresh on Sat, 20 Nov 2021 11:39:17 +0200