首页 > 编程知识 正文

compareto方法返回值(Java中CompareTo()方法的详细介绍)

时间:2023-05-06 19:44:41 阅读:123891 作者:1503

Java的比较to (方法:

对于1.1个字符,返回2个字符的asc代码的差分。

如果参数字符串等于该字符串,则返回值为0; 如果字符串小于字符串参数,则返回小于0的值。 如果字符串大于字符串参数,则返回大于0的值。 字符串str1=' a '; 字符串str2=' b '; system.out.println (str1.com Pareto ) str2); _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _结果: _ _ _ _ _ _ _ _ _ _ _。

String str1='aa '; 字符串str2=' AK '; system.out.println (str1.com Pareto ) str2); _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _结果: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

字符串str5=' ag '; String str6='dvwed '; system.out.println (str5.com Pareto ) str6); ——33543354————————3——3——3——3——————3——3333——333333——333333333——3333333——33333——333——333——3————333——3543543

----------------- 2021.1--------7/sun

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。