Apparently a colon is used in multiple ways in Java. Would anyone mind explaining what it does?
For instance here:
String cardString = "";
for (PlayingCard c : this.list) // <--
{
cardString += c + "\n";
}
How would you write this for-each loop a different way so as to not incorporate the :?
There are several places colon is used in Java code:
Jump-out label (Tutorial):
Ternary condition (Tutorial):
For-each loop (Tutorial):
Assertion (Guide):
Case in switch statement (Tutorial):
Method references (Tutorial)