Both returns an int value.length parameter is used with String array to get the number of elements of array and length()method is used with String Buffer to get the length.
length()is a method that is defined in String class whenever length is a property of array that is defined in JVM. because in java array is dynamic , means array are object and contain memory at runtime.
length is an instance variable of array and it returns the number of elements in that array, while length() is a method of String class. length() method returns the length of the string which is equal to the Unicode code units in that string.
Write a java standalone program / method to take out all the special characters in the string provided below. //ASCII a ? z (97 ? 122) String sSENTENCE = ?This!is^a$t*e)s|t?;