比较字符或者字符串大小,并转成大写输出
public class Personal {public String method(String a, String b) {if (a == b) {return a;}if (a.compareTo(b) > 0) {a = a.toUpperCase();return a;}b = b.toUpperCase();return b;}public static void main(String[] args) {Personal p=new Personal();String str=p.method("db", "cd");System.out.println(str);}}?
?