public class acc
{
public static void main(String argv[])
{
main_get();
}
public static void main_get()
{
String str="abcdefg";
showresult(str.length());
showresult(str.charAt(3));
showresult(str.indexOf('c'));
showresult(str.indexOf('d', 1));
showresult(str.indexOf("e"));
}
public static void showresult(Object obj)
{
System.out.println(obj);
}
}
eclipse上还说:The method showresult(Object) in the type acc is not applicable for the arguments (int)
The method showresult(Object) in the type acc is not applicable for the arguments (int)
谁知道原因? |
|