WHAT IS THE DIFFERENCE BETWEEN length() and length?

Length is used to find the length of array
String[] x = new String[3];
System.out.println( x.length);

length() is used to find the length of String.
String x = "test";
System.out.println( x.length());

2 comments: