Monday, April 30, 2012

Regarding expressing array in simpler terms

I am developing application..



    class Wheel {
private int size;

Wheel(int s) {
size = s;
}

void spin() {
System.out.print(size + " inch wheel spinning, ");
}

}

public class Bicycle {
public static void main(String[] args) {
Wheel[] wa = { new Wheel(15), new Wheel(17) };
for (Wheel w : wa)
w.spin();
}
}


But Please advise that how could we express Wheel[] wa = { new Wheel(15), new Wheel(17) }; in more simpler terms.





No comments:

Post a Comment