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.
- Data Science
- Cloud Computing
- Java Beans
- Mac OS X
- Office 365
- Tech Reviews
Subscribe to Tutorials
1. hey i can write more simple example of this pointe
View Tutorial By: shruti at 2010-03-03 09:44:58
3. setting on my nokia 7610 on mtn using operamini 4.
View Tutorial By: DREAD at 2010-06-21 07:40:13
4. 1==how can we use vb.net web service data in JSF?<
View Tutorial By: kumaraswamy at 2009-01-06 23:56:53
6. To install 32 bit java Communication API you can f
View Tutorial By: Shailendra at 2013-04-06 14:49:44
9. thanks man really very nice and helpful...........
View Tutorial By: Bakhtawar khan at 2012-12-05 05:54:18
10. I have a computer science lab final on tuesday (09
View Tutorial By: kudas at 2009-06-07 10:55:06