求指导!写了两天了...
import *;import java.util.*;
import java.util.Scanner;
public class MyStringBuffer{
public static void main(String[] args){
Scanner s = new Scanner(System.in);
Scanner m = new Scanner(System.in);
String str1 = s.next();
String str2 = s.next();
if(equals(str1,str2))
System.out.println("stringbuffer1 equal to stringbuffer2");
else
System.out.println("stringbuffer1 not equal to stringbuffer2");
}
public static boolean equals(StringBuffer sb1,StringBuffer sb2){
boolean flag=false;
String a=new String(sb1);
String b=new String(sb2);
if(a.equalsIgnoreCase(b)){
return !flag;
}
else{
return flag;
}
}
}
那位大侠能帮我改改吗?