Learn Java Programming - String Class Tutorials length()

preview_player
Показать описание
In this tutorial I will discuss the length() method. The length method returns the number of characters (unicode) in the string.
For example,
String apples = "Apples";
String oranges = new String("Oranges");
It is noteworthy to mention that an array has a variable named length. It is easy to confuse the two, a string object has a method .length() that returns the number of characters in a string, and an array has a public instance variable .length that returns the number of elements in an array.
Рекомендации по теме
visit shbcf.ru