0
int[ ] x= new int[7+0]. when check length it shows 7.... while if it counts from 0 it should have a pength of 8.
4 Antworten
0
It will count from 0 to 6 not 0 to 7 so the length is 7
0
see when it counts it counts from 0-6 which total value is 7. while counting it counts TILL that number (excluding the number). hope you got my point
0
the index of array starts counting from zero not size. array having size 1 will have only index zero 0
0
but when i add 0 it should place a no. at 0 as well but now i got it as the 0 is already initialized so it is not gonna count 0 again