Java SE Bronze Exam Number: 1Z0-818 (Loop Statement) (October 2020)

Official site: Java SE Bronze

oracle.PNG

Purpose

: cherry_blossom: ** Java Bronze SE passed **: cherry_blossom:

table of contents

1, while Use of statement 2, for Use of statements and extended for statements 3, do-while Creating and using statements 4, Loop nesting

oracle java.PNG Official site: The Java ™ Tutorials

1, Using the while statement

while statement while (** condition **): As long as the condition is ** true **, it loops infinitely.

WhileDemo.java


class WhileDemo {
	public static void main(String[] args) {		
		int count = -10;
		while(count < 1) {
			System.out.println("Count is : " + count);
			count++;
		}
	}
}

2, Use for and extended for statements

for statement

ForDemo.java


class ForDemo {
	public static void main(String[] args) {		
		for(int i = 0; i < 11; i++) {
		System.out.println("Count is : " + i);
	}
}

Extended for statement

EnhancedForDemo.java


class EnhancedForDemo {
	public static void main(String[] args) {
		
		int[] numbers = {1,2,3,4,5,6,7,8,9,10};
		for(int item : numbers) {
			System.out.println("Count is : " + item);
        }
	}
}

3, do-while Creating and using statements

do-while statement Display once regardless of the condition.

DoWhileDemo.java


class DoWhileDemo {
	public static void main(String[] args) {		
		int count = 1;
		do {
			System.out.println("Count is : " + count);
			count++;
		}while(count < 11);	
	}
}

4, loop nesting

Describe the for statement in the nesting for statement. The source code below represents the multiplication table.

Nesting.java


class NestingDemo {
	public static void main(String[] args) {		
		for(int i = 1; i < 10; i++) {
			for(int j = 1; j < 10; j++) {
				System.out.print((i * j) + ",");	
			}
			System.out.println("");	
	}
}

Remarks

1, Data Declaration and Use 2, Loop statement

Recommended Posts

Java SE Bronze Exam Number: 1Z0-818 (Loop Statement) (October 2020)
Java SE Bronze Exam Number: 1Z0-818 (Data Declaration and Use) (October 2020)
Java SE Bronze (1Z0-818) Passing Experience
Java SE Bronze exam test content
Java SE 8 Sliver exam questions
Orcacla Java Bronze SE 7/8 Qualification Study
Loop statement
[Qualification Exam] (Java SE8 Gold) Learning Review & Summary
I got stuck while studying Java SE 7/8 Bronze
Students challenged Java SE 7/8 Bronze with no diligence.
[Qualification Exam] Java SE 8 Silver Learning Method Summary