×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: Cuong Vo
Added: May 9, 2013 9:54 AM
Modified: May 20, 2013 2:31 AM
Views: 38
Tags: enum java string
  1. package net.viralpatel.java.enum;
  2.  
  3. public enum Weekdays {
  4.     Monday,
  5.     Tuesday,
  6.     Wednesday,
  7.     Thursday,
  8.     Friday,
  9.     Saturday,
  10.     Sunday
  11. }
  12.  
  13. Weekdays weekday = Weekdays.valueOf("Monday");
  14. System.out.println(weekday);
  15.  
  16.