public class MyName { public static void main(String[] args) { int[] num = new int[5]; num[0] = 15; num[1] = 33; System.out.println(num[1]); } } public class MyName { public static void main(String[] args) { int[] num = new int[5]; num[0] = 15; num[1] = 33; num[2] = 52; num[3] = 85; num[4] = 55; System.out.println(num[4]); } } public class MyName { public static void main(String[] args) { int num[] = { 1, 8, 9, 5 }; System.out.println(num[0] + " " + num[1]); } } public class MyName { public static void main(String[] args) { int num[] = { 1, 8, 9, 5 }; System.out.println(num[0] + " " + num[1]); } } public class MyName { public static void main(String[] args) { int num[] = { 1, 8, 9, 5 }; System.out.println(num[0] + " " + num[1]); num[0] = 55; System.out.println(num[0]); } } public class MyName { public static void main(String[] args) { int num[] = { 1, 8, 9, 5 }; System.out.println(num[0] + " " + num[1]); num[0] = 55; System.out.println(num.length); } } public class MyName { public static void main(String[] args) { double[] arr = new double[6]; System.out.println(arr[0]); } } public class MyName { public static void main(String[] args) { int[] arr = new int[6]; System.out.println(arr[0]); } } public class MyName { public static void main(String[] args) { //char[] arr = new char[6]; // char arr[0] = 'a'; //char arr[5]={'a','b','c','d'} System.out.println(arr[0]); } } public class MyName { public static void main(String[] args) { String[] arr = { "Ali", "Ahmed", "Belal" }; System.out.println(arr[0]); } } public class MyName { public static void main(String[] args) { String[] arr =new String[] { "Ali", "Ahmed", "Belal" }; System.out.println(arr[0]); } } public class MyName { public static void main(String[] args) { String[] arr = new String[] { "Ali", "Ahmed", "Belal" }; System.out.println(arr[0]); System.out.println(arr[1]); System.out.println(arr[2]); } } public class MyName { public static void main(String[] args) { String[] arr = { "Ali", "Ahmed", "Belal" }; /* * System.out.println(arr[0]); System.out.println(arr[1]); * System.out.println(arr[2]); */ for (String i : arr) { System.out.println(i); } } } public class MyName { public static void main(String[] args) { String[] arr = { "Ali", "Ahmed", "Belal" }; for (int i = 0; i < arr.length; i++) { System.out.println(i); } } } public class MyName { public static void main(String[] args) { String[] arr = { "Ali", "Ahmed", "Belal" }; /* * for (int i = 0; i < arr.length; i++) { System.out.println(i); } */ for (String i : arr) { System.out.println(i); } } } public class MyName { public static void main(String[] args) { String[] arr = { "Ali", "Ahmed", "Belal" }; /* * for (int i = 0; i < arr.length; i++) { System.out.println(i); } */ for (String i : arr) { System.out.println(i); } } } import java.util.Scanner; public class MyName { public static void main(String[] args) { Scanner input = new Scanner(System.in); int size = input.nextInt();// short data type int[] arr = new int[size]; arr[0] = 15; System.out.println(arr[0]); } }