Skip to content
Snippets Groups Projects
Commit ded6b6b7 authored by Mahboobe Shakeri's avatar Mahboobe Shakeri
Browse files

adding array example

parent d8b9967e
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,36 @@ public class Main {
System.out.println("changes in the merge");
System.out.println("Hello Mahboobe changing the code online!");
int[] Mynumbers ={1,3,4,6};
int[] Mynumbers2 = new int[4];
Mynumbers2[0] = 5;
Mynumbers2[1] = 7;
Mynumbers2[2] = 9;
Mynumbers2[3] = 10;
//
// for(int i=0; i < Mynumbers.length; i++){
// System.out.println("myNumber array value that index " + i + "\t is \t" + Mynumbers[i]);
// }
// Mynumbers[0] = 27;
// for(int i=0; i < Mynumbers.length; i++){
// System.out.println("myNumber array value that index " + i + "\t is \t" + Mynumbers[i]);
// }
//
// for(int number: Mynumbers) {
// System.out.println("myNumber array value is \t" + number);
// }
String[] fruits = {"Apple", "Banana", "Mango"};
for(String fruit: fruits) {
System.out.println("fruit name is \t" + fruit);
}
for(int i=0; i< fruits.length; i++) {
System.out.println("fruit name is \t" + fruits[i]);
}
// int Mynumber = 25;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment