Post on 09-Mar-2016
description
Java enum example:
Below enum defines different types of dialog types.
public enum CustomerDialogType {
ADD_DIALOG("ADD ADDRESS"), EDIT_DIALOG("EDIT ADDRESS"), NEW_CUSTOMER("NEW CUSTOMER");
private String title;
private CustomerDialogType(String title) { this.title = title; }
public String getTitle() { return title; } } Very simple enum class describing different types of dialogs possible in an application. Instead of using hard-coded strings this can be made use of to name a dialog.