CoolInterview.com - World's Largest Collection of Interview Questions
Send Free SMS
 Interview Questions  
 Our Services  


INTERVIEW QUESTIONS J2EE JAVA DETAILS
Question :
What is the difference between length and length() ?
Category Java Interview Questions
Rating (5.0) By 22 users
Added on 5/20/2008
Views 1266
Rate it!
Answers:



length() is function which is defined for string class whereas length is used only for array.



 Posted by: seema pawar    

Contact seema pawar  Contact seema pawar

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.



 Posted by: Daliya    

Contact Daliya  Contact Daliya

length - keyword , find out the array length

// length() - method , find out the String length



 Posted by: vishal singh    

Contact vishal singh  Contact vishal singh

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.



 Posted by: Tarique Anwer    

Contact Tarique Anwer  Contact Tarique Anwer

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.



 Posted by: Sandeep Bhardwaj    

Contact Sandeep Bhardwaj  Contact Sandeep Bhardwaj


If you have the better answer, then send it to us. We will display your answer after the approval.
Name :*
Email Id :*
Answer :*
Verification Code Code Image - Please contact webmaster if you have problems seeing this image code Not readable? Load New Code
Process Verification  Enter the above shown code:*
Inform me about updated answers to this question

   
Related Questions
View Answer
What is the difference between concat and append?
View Answer
What is the difference between Java and J2EE? Is J2EE advanced version of Java?
View Answer
How do u create objects at runtime?
View Answer
What is a string Handling? How to use it? what is difference b/w Event handling?
View Answer
What is multi threading ?
View Answer
What are the main differences between
jdk1.4 n jdk1.5?
View Answer
Given A = 1, B = 2, C = 3, D = 4 ?? Z = 26, write a java standalone
program to encode the word ?TELEPHONE? into numbers.
View Answer
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?;
View Answer
Why pointers are not used in java?
View Answer
What is super class of an Exception class?
View Answer

Please Note: We keep on updating better answers to this site. Subscribe to our newsletter to get notified when better answer is posted.

Notify me when better answer is posted!
Email:

View ALL Java Interview Questions

User Options
Sponsored Links


Copyright ©2003-2010 CoolInterview.com, All Rights Reserved.
Privacy Policy | Terms and Conditions
Page URL: http://www.coolinterview.com/interview/15169/default.asp?cachecommand=bypass


Download Yahoo Messenger | Placement Papers| FREE SMS | ASP .Net Tutorial | Web Hosting | Free SMS | Dedicated Servers | Joke of the Day

0.8