String[] variable vs String variable[]???
in
Programming Questions
•
1 year ago
I thought the difference between the two was the first is an array of 6 strings while the second was a string of size six in an array but I put a string in is larger than six so this cant be right. What, where, when to use which??? Same thing with i++ and ++i to increment and de-increment --i and i--...they both seem to do the same thing.
- String[] target1 = new String[6]; //target1 is an array of 6 strings?
- String target2[] = new String[6]; //target2 is a string of size 6?
- for(int i=0; i<target1.length;i++) {
- target1[i] = "target1String";
- }
- for(int i=0; i<target2.length;++i) {
- target2[i] = "target2String";
- }
- for(int i=0; i<target1.length;i++) {
- println(target1[i]);
- }
- for(int i=0; i<target2.length;i++) {
- println(target2[i]);
- }
Thank you for the comments.
McK
McK
1