aspose file tools*
The moose likes Beginning Java and the fly likes why dsnt it works Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "why dsnt it works" Watch "why dsnt it works" New topic
Author

why dsnt it works

satwant singh
Greenhorn

Joined: Dec 02, 2008
Posts: 6
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

Joined: Nov 24, 2005
Posts: 14688
    
  16

not at my home having same configuration

Are you using Java5 at home ? Try to type "java -version" at the command line.


[My Blog]
All roads lead to JavaRanch
Nitin Pathak
Ranch Hand

Joined: Sep 25, 2006
Posts: 70
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.
 
Consider Paul's rocket mass heater.
 
subject: why dsnt it works