java for Statement and enhanced for Statement :
/*
* www.developerpages.gr
* Java for Statement
*/
package forstatement;
public class ForStatement {
public static void main(String[] args) {
System.out.println("The for Statement");
System.out.println("-----------------");
for (int i = 0; i<10;i++){
System.out.println("Step : " + i );
}
// enhanced for statement
System.out.println("enhanced for statement");
System.out.println("----------------------");
int[] nums = {1,2,3,4,5,6,7,8,9,10};
for (int item : nums){
System.out.println("Step : " + item );
}
}
}
the output is :
Original Article : http://developerpages.gr/index.php/el/desktop-development-2/java/65-java-for-statement
/*
* www.developerpages.gr
* Java for Statement
*/
package forstatement;
public class ForStatement {
public static void main(String[] args) {
System.out.println("The for Statement");
System.out.println("-----------------");
for (int i = 0; i<10;i++){
System.out.println("Step : " + i );
}
// enhanced for statement
System.out.println("enhanced for statement");
System.out.println("----------------------");
int[] nums = {1,2,3,4,5,6,7,8,9,10};
for (int item : nums){
System.out.println("Step : " + item );
}
}
}
the output is :
Original Article : http://developerpages.gr/index.php/el/desktop-development-2/java/65-java-for-statement
No comments:
Post a Comment