Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
pradeep rajkumar
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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
Pie
Posts: 64629
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is simply one of the formats of a for-loop. It has nothing todo with enums.
 
pradeep rajkumar
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yup, I just now found it.
Its a kind of "For Each" loop in java.
Thank you.!!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic