This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

why dsnt it works

 
satwant singh
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have made an enhaced for loop that is foreach type loop in java
i.e/ like

int arr[]={1,2,3,4};
for(int x:arr)
System.out.println(x);


it works properly in my office pc having configuration
ASUS-945 mb
1 gb ram
160 gb hdd
windows xp prof
but
not at my home having same configuration

there occured errors like
must use ; in plce of :
help me
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
not at my home having same configuration

Are you using Java5 at home ? Try to type "java -version" at the command line.
 
Nitin Pathak
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The new syntax of array iteration mentioned below has been introduced as part of J2SE 5.0.

Try upgrading your PC Java version to 5 (as rightly pointed out by Christophe) and you should be all set with the minimal hardware configuration.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic