This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question about redefining Enum

 
Kaydell Leavitt
Ranch Hand
Posts: 689
Eclipse IDE Firefox Browser Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a question about one of the question on Marcus Green's eXamulator 5.0. Enum is defined in the package java.lang, java.lang is automatically imported and you can't redefine a class at the same level right?

I don't understand how the following code works:

I also don't understand why the checkbox is declared as an int when we're working with enums.

 
shakunthala Divakar
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

If you add java.lang.Enum then the given code doesn't compile.
and If you add [code] java.lang.* and also which is by default added, then it compiles fine.

so i belive that , the class Enum is not imported until you use that in your code without defining it.
In the given code.If you use Enum next then,that will not be from java.lang instead that will be the one you defined.
I think Enum is not redefined,as it is not imported yet
 
Manfred Klug
Ranch Hand
Posts: 377
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Kaydell Leavitt:
I also don't understand why the checkbox is declared as an int when we're working with enums.[/CODE]
Since they are two different things which only share the name.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic