Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

enums with values in java

public enum Element {
    H("Hydrogen"),
    HE("Helium"),
    // ...
    NE("Neon");

    public final String label;

    private Element(String label) {
        this.label = label;
    }
}
Comment

Java Enum valueOf()

Size.valueOf("SMALL")
// returns constant SMALL.
Comment

Java Enum values()

Size[] enumArray = Size.value();
Comment

PREVIOUS NEXT
Code Example
Java :: how to get last index of array in java 
Java :: how to draw a circle in java swing 
Java :: java printstacktrace 
Java :: searchview android example recyclerview 
Java :: lombok 
Java :: number of digits program in java 
Java :: java, how to find the most repeated character 
Java :: first and last element of array java 
Java :: javafx initialize 
Java :: java swing change label icon 
Java :: style jbuttons 
Java :: $950 at 6% per annum for three years. 
Java :: como limpar a tela do consola no java 
Java :: java manipulate alphabet list 
Sql :: ERROR 1819 (HY000): Your password does not satisfy the current policy requirements 
Sql :: postgresql stop all connections 
Sql :: select all fields in soql 
Sql :: mysql alter column default 
Sql :: mysql how to reset primary key 
Sql :: oracle list columns schema 
Sql :: postgresql db owner change 
Sql :: how to check port number for postgresql 
Sql :: sql server version query 
Sql :: get schema of table sql 
Sql :: mysql change root mysql_native_password 
Sql :: how to open postgresql in mac 
Sql :: oracle turn off constraint 
Sql :: mysql delete row 
Sql :: sqlite connection string 
Sql :: Create a keyspace cassandra 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =