Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

compareTo() method query  RSS feed

 
Vishal Hegde
Ranch Hand
Posts: 1078
Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,


I am reading CompareTo() method in Java and want to know is -10 and +10 the default value and how it is decided that which String is greater then the other is it , with refernce from its length.

 
Campbell Ritchie
Marshal
Posts: 56562
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unzip the src.zip file in your Java installation folder and look inside the java folder for the lang folder and the String class and read its compareTo method.
Read the documentation.
 
Vishal Hegde
Ranch Hand
Posts: 1078
Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you

this means



current<joining ??? Am i correct???
 
Campbell Ritchie
Marshal
Posts: 56562
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You ought to explain your questions a bit better, but I think, yes.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!