• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Basic For Loop Issue

 
Ranch Hand
Posts: 316
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Assertion : Here goes the basic for loop syntax

for(Initialization Part ; Condition Test ; Iterator part )

Referring to initialization part :- It is writtten in the K&B book that if there are multiple variables in an Initialization part then

1) they must be separated by commas
2) they must be of same type.

Problem :- Second point seems to be partially true

Following are perfectly working



In above f and d are of different types.



This is also working.

Could you please elaborate the logic ???
What exactly going on ??

Thanks !!!

 
Ranch Hand
Posts: 446
1
Eclipse IDE MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
They mean to say
you cannot write


 
reply
    Bookmark Topic Watch Topic
  • New Topic