• 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
Posts: 65664
129
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.!!!
 
You've gotta fight it! Don't give in! Read this tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!