Computer Science, asked by ranashabnam034, 7 months ago

java does not allow arrays length of zero
true or false please tell me

Answers

Answered by triveni979417krati
1

Answer:

Down vote

Accepted

It signifies that it is empty. I.e. you can loop over it as if it had items and have no result occur:

for(int k = 0; k < strings.length; k++){

// something

}

Thereby avoiding the need to check. If the array in question were null, an exception would occur, but in this case it just does nothing, which may be appropriate.

Similar questions