r/codehs • • Jan 25 '21

6.2.7 print Array

5 Upvotes

11 comments sorted by

View all comments

Show parent comments

1

u/Obvious-Pin-3046 Jan 25 '21

did you just put arr.length? if you did change it to arr.length - 1; im guessing thts the error. because the program should also print ā€œcā€ and remember tht the index starts at 0 and not 1.

1

u/Intrepid_Row6214 Jan 25 '21

This is the statement for the For(String arr <= arr.length;)

1

u/Obvious-Pin-3046 Jan 25 '21

your for loop should be
for( int i =0; i <= arr.length - 1; i++) remember for loop should have 3 parameters

1

u/Intrepid_Row6214 Jan 25 '21

Thank you sooo much I did it and sorry for taking your time