/**
*
*/
package com.konzern.transformatore.enums;
/**
* @author konzernites
* @version 1.0
*
*/
public enum CobolDivision {
IDENTIFICATION_DIVISION("IDENTIFICATION DIVISION."),
DATA_DIVISION("DATA DIVISION."),
PROCEDURE_DIVISION("PROCEDURE DIVISION."),
ENVIRONMENT_DIVISION("ENVIRONMENT DIVISION.");
private String division = null;
private CobolDivision(String division) {
this.division= division;
}
public String getDivision() {
return division;
}
}
*
*/
package com.konzern.transformatore.enums;
/**
* @author konzernites
* @version 1.0
*
*/
public enum CobolDivision {
IDENTIFICATION_DIVISION("IDENTIFICATION DIVISION."),
DATA_DIVISION("DATA DIVISION."),
PROCEDURE_DIVISION("PROCEDURE DIVISION."),
ENVIRONMENT_DIVISION("ENVIRONMENT DIVISION.");
private String division = null;
private CobolDivision(String division) {
this.division= division;
}
public String getDivision() {
return division;
}
}
import java.util.ArrayList;
import java.util.List;
import com.konzern.transformatore.enums.CobolDivision;
/**
* 8281808029
*/
/**
* @author Consumerfed
*
*
*/
public class EnumsTestClass {
/**
* @param args
*/
public static void main(String[] args) {
List<String> cobolDivisions = new ArrayList<>();
for (CobolDivision cobolDivison : CobolDivision.values()) {
cobolDivisions.add(cobolDivison.getDivision());
System.out.println(cobolDivison.getDivision());
}
System.out.println(cobolDivisions.size());
}
}
Output
IDENTIFICATION DIVISION.
DATA DIVISION.
PROCEDURE DIVISION.
ENVIRONMENT DIVISION.
4
No comments:
Post a Comment
Your feedback may help others !!!