how to find the size of an string in java code example Example: length of string in java str.length();