• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 236
  • Last Modified:

string.compareTO(string);

what does this function returns ?
i tried and it returns numbers
0 if equals ?
how about the others ?
0
prinx
Asked:
prinx
1 Solution
 
Peter KwanAnalyst ProgrammerCommented:
Return value of a.compareTo(b), where a and b are both of type String:

If a is equal to b, then 0.
If a is lexicographically less than b, then a value less than 0.
If a is lexicographically greater than b, then a value greater than 0.

For more info, please read:
http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html#compareTo(java.lang.String)
0
 
prinxAuthor Commented:
yea i read that, sorry for not being clear but what i mean it the return value what does it means for eg it returns 25 for one time..why 25 ?
0
 
OviCommented:
Probably the algorithm of the method use some control values (distances) which are returned.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

Tackle projects and never again get stuck behind a technical roadblock.
Join Now