Java (4) enumeration class

@

1、 Introduction to enumeration class

2、 Custom enumeration class

1. Method 1: jdk5 Custom enumeration class before 0

2. Mode 2: jdk5 0, define enumeration class with enum keyword

3、 Main methods of enum class

1、toString()

2、values()

3、valueOf(String str)

4、 The enum class defined by enum keyword is used to implement the interface

1. Situation 1

2. Case 2:

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>