int[] nums = {10, 20, 30, 40}; //printing array println("nums: " + Arrays.toString(nums)); //length of array int l = nums.length; println("Length of nums array is: " + l); //getting an element int elem = nums[2]; println("Number at index=2 is: " + elem); //putting a new elem at a specified index nums[2] = 999; println("Changed number at index=2 to 999"); println("nums: " + Arrays.toString(nums));