当前位置: 代码迷 >> J2SE >> 这个endWith运用为啥不成功
  详细解决方案

这个endWith运用为啥不成功

热度:59   发布时间:2016-04-23 21:12:54.0
这个endWith运用为什么不成功?
如题

public class Test
{
public static void main(String[] args)
{
 String greeting = "abcd";
boolean x = greeting.endWith("cd");
 System.out.println(x);
}
}


出现这样的结果

------解决方案--------------------
endWith 少了个s 应为endsWith
  相关解决方案