This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Java in General and the fly likes Trying to learn enumerated types of class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Trying to learn enumerated types of class" Watch "Trying to learn enumerated types of class" New topic
Author

Trying to learn enumerated types of class

naved momin
Ranch Hand

Joined: Jul 03, 2011
Posts: 682

i m trying to learn enumerated types of class , but when i was compiling it produced an error , i cant solve this please tell me whats wrong





The Only way to learn is ...........do!
Visit my blog http://inaved-momin.blogspot.com/
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19556
    
  16

It should be public class TestProgram. That solves all but one compiler error.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
naved momin
Ranch Hand

Joined: Jul 03, 2011
Posts: 682

Rob Spoor wrote:It should be public class TestProgram. That solves all but one compiler error.

what is the actual use of doing this , i mean we can do this without enum also , so why we need enum ???
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19556
    
  16

When you create a type, that type must be an interface, a class or an enum. You must specify which of the three; the enum keyword simply replaces the class keyword in the type declaration.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Trying to learn enumerated types of class
 
Similar Threads
Overriding equals() method within a subclass
Compare an Object to an Enum list
Arraylist insights
cannot read a Collection of a custom class as a parameter
enums