File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of Spring in Action this week in the Spring forum!
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: 61413
    
  67

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.!!!
 
 
subject: What is the use of colon ":" symbol in assigning the values for Enum ?