Java Tutorial - 05 - Using Array Length Instance Variable

preview_player
Показать описание

Learn how to program in java with our online tutorial. We will cover variables, loops, if else branching, arrays, strings, objects, classes, object oriented programming, conditional statements, and more.

Here we use the length of the array as an instance variable.
Рекомендации по теме
Комментарии
Автор

I really like your courses, much information provided in a clear way to understand., thank you! One tip regarding this lesson. It is much easier just to make loop like this:
for (int i = 0; i < jason.length; i++)

instead of using i <= jason.length-1


I always use for arrays '<' instead of '<=' - this way you never had to remember about putting -1

AdamGuitar
Автор

You can also remove the = sign in <= to be simplier.

jayrdekya
Автор

Thank you, I bumped into this on my notes but couldn't remember how it worked and this made it very clear :)

JosephGallagher
Автор

Does apersand give a problem while calculation length?

wolf_crusher