Please follow comments mentioned at every step
public class Main {
public static void main(String[] args) {
int[] numbers = {1, 2, 3}; // create a new array of intergers as {1,2,3}
int length = numbers[2]; // assign 3 to variable 'length'
char[] chars = new char[length]; // create a char array of size 3
chars[numbers.length-1] = 'y'; // assign 'y' to index 2 of chars array
System.out.println("Done!"); // print DONE to console ( and this will print everytime as no conditions involved)
}
}
solved I am a newbie in Java, what is the logic about below code? [closed]