File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

why dsnt it works

satwant singh

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)

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

there occured errors like
must use ; in plce of :
help me
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

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.
I agree. Here's the link:
subject: why dsnt it works
It's not a secret anymore!