Java untuk Loop
for (int i = 0; i < 5; i++) {
System.out.println(i);
}
Ill Ibis
for (int i = 0; i < 5; i++) {
System.out.println(i);
}
class Main {
public static void main(String[] args) {
char[] vowels = {'a', 'e', 'i', 'o', 'u'};
// iterating through an array using a for loop
for (int i = 0; i < vowels.length; ++ i) {
System.out.println(vowels[i]);
}
}
}
for(int i = 0; i < 5; i++){
System.out.println(i);
}
for(int i = 0; i < 10; i++) {
System.out.println(i);
}
for(i=0:i>0;i++) else System.out.println("Hello World.");
class for_loop
{
public static void main(String args[])
{
for(int i=0;i<10;i++)
{
System.out.print(" " + i);
}
/*
Output: 0 1 2 3 4 5 6 7 8 9
*/
}
}
for(int i = 1; i <= 5; i++) {
System.out.println(i);
}