Skip to content

Commit 8f7c601

Browse files
Merge pull request #164 from bintangsholu21/main
add print array java
2 parents 4379e61 + 4b91aae commit 8f7c601

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Java/Random/Array/printArray.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
public class printArray {
2+
public static void main(String[] args) {
3+
String[] arr = { "BMW", "Toyota", "Mercedes Benz", "Daihatsu" };
4+
for (int i = 0; i < arr.length; i++) {
5+
System.out.println((i + 1) + ". Car Brand : " + arr[i]);
6+
}
7+
}
8+
}

0 commit comments

Comments
 (0)