I have an array of 28 characters. I’m trying to use a for loop to print the string and its length so that the next line removes the last character from the previous line. For example:
7 Example
6 Exampl
5 Examp
4 Exam
3 Exa
2 Ex
1 E
I have this so far, but it’s not printing. What am I doing wrong?
for(int index=28; index <= nameArray.length; index--)
{
System.out.print(nameArray[index]);
}
It is as simple as that ..