This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes What is the use of colon Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "What is the use of colon ":" symbol in assigning the values for Enum ?" Watch "What is the use of colon ":" symbol in assigning the values for Enum ?" New topic
Author

What is the use of colon ":" symbol in assigning the values for Enum ?

pradeep rajkumar
Greenhorn

Joined: May 26, 2011
Posts: 10


in line number 6 it is given with a colon symbol like this,

for(Days d : Days.values() )


so what does that intended to do ?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61310
    
  66

It is simply one of the formats of a for-loop. It has nothing todo with enums.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
pradeep rajkumar
Greenhorn

Joined: May 26, 2011
Posts: 10
Yup, I just now found it.
Its a kind of "For Each" loop in java.
Thank you.!!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What is the use of colon ":" symbol in assigning the values for Enum ?