How to find the length of a String using the Java String length() method - Java Tutorial
Coding River
How to find the length of a String using the Java String length() method - Java Tutorial For Absolute Beginners
In this video, we will learn to use the Java String length() method. With this method, we can be able to find out the length of a String. What this method does is that it counts the number of characters in a String including the white spaces. After counting all the characters it returns an integer number representing the total number of characters in a given String Example public class LengthExample{ public static void main(String args[]) { String sentence1 = "Hello World !"; String sentence2 = "My name is Kely";
System.out.println("Length of String 1 = "+sentence1.length());
System.out.println("Length of String 2 = "+sentence2.length());
} }
#codingriver #java #programmi ... https://www.youtube.com/watch?v=i5suq7fKB1A
8930829 Bytes