Converting Java code to D

Mike James via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Apr 20 08:28:03 PDT 2015


Here is a fragment of Java code from an SWT program...

public enum LineStyle {
     NONE("None"),
     SOLID("Solid"),
     DASH("Dash"),
     DOT("Dot"),
     DASHDOT("Dash Dot"),
     DASHDOTDOT("Dash Dot Dot");

     public final String label;

     private LineStyle(String label) {
         this.label = label;
     }
}

What would be the best ('canonical') way of translating it to D?

Regards,

-=mike=-


More information about the Digitalmars-d-learn mailing list