Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
Introduction to Programming 1

Introduction to Programming 1

Ratings: (0)|Views: 3|Likes:
Published by eragol

More info:

Published by: eragol on Feb 28, 2010
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

02/28/2010

pdf

text

original

 
Introduction to Programming 1
1
J9a Enum type
 
Introduction to Programming 1
2
Enum
An
enum type
is a type whose
 fields
consist of afixed set of constants.
public enum Day {
 
SUNDAY, MONDAY, TUESDAY,WEDNESDAY, THURSDAY, FRIDAY, SATURDAY
}
 
Introduction to Programming 1
3
Example 1
public class EnumTest {
 
Day day;
 
public EnumTest(Day day) {
 
this.day = day;
 
}
 
public void tellItLikeItIs() {
 
switch (day) {
 
case MONDAY:System.out.println("Mondays are bad.");
 
break;

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->