Merge pull request #219 from dreamysap/Sapna-JavaChanges

Updated java.md
This commit is contained in:
Julien Le Coupanec 2021-07-17 14:51:56 +02:00 committed by GitHub
commit a2d51368dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 0 deletions

View File

@ -196,6 +196,24 @@ int c = a + b;
System.out.println(i);
}
```
>Enhanced for loop/for-each
```java
for(dataType item : array) {
...
}
```
**Example:**
```java
// array of numbers
int[] numbers = {100, 200, 300, 400};
// for each loop
for (int number: numbers) {
System.out.println(number);
```
> WHILE LOOP STATEMENT
```java
while(condition){ //till condition will be true.