Skip to content

Commit

Permalink
add print array java
Browse files Browse the repository at this point in the history
  • Loading branch information
bintangsholu21 committed Oct 24, 2022
1 parent 536c68f commit d66bc7f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions arrays/printArray.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
public class printArray {
public static void main(String[] args) {
String[] arr = { "BMW", "Toyota", "Mercedes Benz", "Daihatsu" };
for (int i = 0; i < arr.length; i++) {
System.out.println((i + 1) + ". Car Brand : " + arr[i]);
}
}
}

0 comments on commit d66bc7f

Please sign in to comment.