Question from the Java - Fundamentals test

Print the value of the enum Color.BLUE

Hard

Given this code :

enum Color{
    BLUE(0), RED(1), GREEN(2);

    int value;

    Color(int value){
        this.value = value;
    }
}
public class QuestionJava {
    public static void main(String[] args){
            System.out.println(Color.BLUE);
    }
}

What will this code display?

Author: PierreStatus: PublishedQuestion passed 576 times
Edit
1
Community Evaluations
developer avatar
Florian
19/02/2022
There's a spelling error here in the code. The author, obviously French, wrote "Colors.BLEU" instead of "Colors.BLUE". It can lead you to think you should answer "a mistake" whereas it's not the author's intention
developer avatar
Auteur anonyme
19/02/2022
Thanks Florian, we'll fix this typo ASAP
developer avatar
Auteur anonyme
21/02/2022
Fixed ! Thank you Florian.