Comment on Tutorial - compareTo( ) in Java By Mashoud
Comment Added by : Azher
Comment Added at : 2010-01-29 12:23:39
Comment on Tutorial : compareTo( ) in Java By Mashoud
CompareTo returns the difference of the ASCII codes of the first non-matching character. So,
out.print(sOne.compareTo(sTwo)); would display
// (sTwo - sOne)
('a' - 'e') which is -4.
out.print(sTwo.compareTo(sOne)) would display
//(sOne - sTwo)
('e' - 'a') which is 4.
Hope this will help you.
- Cloud Computing
- Java Beans
- Mac OS X
- Office 365
- Tech Reviews
Subscribe to Tutorials
4. Thanks a lot.. it made my concepts of memmove,mems
View Tutorial By: Rimmi Jain at 2009-07-23 06:42:01
6. Please help me send sms. I did everything , But no
View Tutorial By: Prabhash V S at 2009-06-03 06:40:55
9. Thanks, It's exactly. A my friends has the same is
View Tutorial By: Slim at 2012-09-29 02:52:12