Solved

string.compareTO(string);

Posted on 2002-03-28
3
175 Views
Last Modified: 2012-05-04
what does this function returns ?
i tried and it returns numbers
0 if equals ?
how about the others ?
0
Comment
Question by:prinx
3 Comments
 
LVL 16

Accepted Solution

by:
Peter Kwan earned 50 total points
ID: 6904576
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
 

Author Comment

by:prinx
ID: 6904605
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
 
LVL 9

Expert Comment

by:Ovi
ID: 6904612
Probably the algorithm of the method use some control values (distances) which are returned.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now