This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma 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: 63195
    
  69

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.!!!
 
Have you checked out Aspose?
 
subject: What is the use of colon ":" symbol in assigning the values for Enum ?
 
jQuery in Action, 3rd edition