Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

Java Remove EnumSet Elements

import java.util.EnumSet;
class Main {

    enum Size {
        SMALL, MEDIUM, LARGE, EXTRALARGE
    }
    public static void main(String[] args) {
        // Creating EnumSet using allOf()
        EnumSet<Size> sizes = EnumSet.allOf(Size.class);
        System.out.println("EnumSet: " + sizes);
        // Using remove()
        boolean value1 = sizes.remove(Size.MEDIUM);
        System.out.println("Is MEDIUM removed? " + value1);

        // Using removeAll()
        boolean value2 = sizes.removeAll(sizes);
        System.out.println("Are all elements removed? " + value2);
    }
}
Comment

PREVIOUS NEXT
Code Example
Java :: java default keyword 
Java :: Create all possible substrings of a string java 
Java :: hide tablayout tab android 
Java :: java private access modifier 
Java :: Java 8 merge multiple collections using flatmap 
Java :: You may test the newly compiled and packaged JAR in maven 
Java :: Java Enum toString() 
Java :: Java Single element Annotations 
Java :: stop countdown timer when exiting an activity 
Java :: 4 byte timestamp java 
Java :: Java program pattern program to triangle using 100 numbers 
Java :: Encrypt words facebook 
Java :: how to make jframe full screen 
Java :: your application is missing a valid safety identifier 
Java :: how to clear scoreboard with offline players java 
Java :: java random.nextint 
Java :: Log exception details to string 
Java :: andriod button wont change color 
Java :: start/php2 
Java :: Java program to calculate cubic capacity cc in bikes 
Java :: @android:color/system_neutral1_1000 
Java :: spigot change move speed of living entity creature 
Java :: Second Activity not opening problem 
Java :: Pattern using recursion in Java 
Java :: Java Get float, double and String Input 
Java :: what happens if you return only -1 and 1bute not 0 java 
Java :: trivers json node as node type2 
Java :: Java extract string between two strings 
Java :: spring component 
Java :: what are abstract classes in java 
ADD CONTENT
Topic
Content
Source link
Name
3+8 =