File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Qn on enums

 
cs singh
Ranch Hand
Posts: 36
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all..
do let mw know the ans of following :




thanks,
chani.
 
Bert Bates
author
Sheriff
Posts: 8898
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Chani,

I recognize that question

Anyway, the best way to learn this stuff is to try it out, and then to explain what parts you understand, and what parts are confusing. So, I'll ask the question back to you: What part of this code makes sense to you, and what part are you confused by? For the part that you're confused by, what's your best guess as to what's going on?

Bert
 
cs singh
Ranch Hand
Posts: 36
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bert for the reply!!

In the following code:
when ///line 2 is executing, the control will go to ICELANDIC ( in enum Horse) but i am not getting choosing which option will lead to the result.



Wont this part //* *// will be executed??

Thanks again,
Chani.
 
Bert Bates
author
Sheriff
Posts: 8898
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Chani,

Can you determine what the weight of the PONY and HORSE enum "instances" are? If so, how did they get those weights? Now the question is, what enum mechanism allows the ICELANDIC "instance" to have a weight that's != 1300?

hth,

Bert
 
cs singh
Ranch Hand
Posts: 36
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bert !!
That helped .. i got the answer, only if u insert option D, it will set the weight of ICELANDIC to 800, thats because, only by that way Method getweight() will be called.
I hope i'm not in wrong direction,
Chani.
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[Bert]: I recognize that question

Strangely, though I'd never seen it before, I recognized it too.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic