WELCOME TO JAVA FAQS
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:
Unknown
April 18, 2012 at 11:50 AM
Good ans.
Reply
Delete
Replies
Reply
hitesh kumar
April 29, 2016 at 7:26 AM
Difference Between Length and Length() in Java
Reply
Delete
Replies
Reply
Add comment
Load more...
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
Good ans.
ReplyDeleteDifference Between Length and Length() in Java
ReplyDelete