Enums, bitfields and wl_arrays

Solerman Kaplon solerman at gmail.com
Tue Oct 13 08:19:33 PDT 2015


Em 13-10-2015 11:35, Nils Chr. Brause escreveu:
> In C++ the order doesn't matter either, since each entry has a defined value. 
> I wonder why this is different in Java?

Java Enums doesn't have "value". It just a class instance. But since it's a 
class one can add regular fields to it, like this (writing of the top of my head):

public static enum Orientation {
   Portrait(1), Landscape(2);

   final int value;

   Orientation(int value) {
     this.value = value;
   }

   public int getValue() {
     return this.value;
   }
}

Solerman


More information about the wayland-devel mailing list