what is difference between length and length()?

Answer Posted / shaik baji

length: It's a built-in property to determine the size of
any array.

lenght(): It's a method of java.lang.String class.
Syntax:
-------
public int length()

It returns the length of the string. The length is equal to
the number of 16-bit Unicode characters in the string.

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you have two constructors in java?

513


What are different access specifiers in java? Explain

639


What is the disadvantage of synchronization?

583


What is the java project architecture?

1795


What does g mean in regex?

574






Explain creating threads by extending thread class ?

588


Do extraneous variables affect validity?

536


How do you get length in java?

571


Why declare Main() method as a static in java ?

610


Can we pass a primitive type by reference in java? How

534


What is byte data type?

556


how to know the total memory occupied by the objects in the ArrayList(Array list may contain duplicate objects)

1913


What is static keyword?

596


How do you override a variable in java?

541


How can we achieve thread safety in java?

691