摘要: 直接上代码: 输出: 阅读全文
posted @ 2019-03-25 17:21 lipohong 阅读(353) 评论(0) 推荐(0) 编辑
摘要: 今天测试代码时遇到 Error:(6, 55) java: non-static method sayGoodbye() cannot be referenced from a static context 的报错,代码如下: 原因: 不能直接调用类变量和类方法。 解决方法一: 将方法改成类方法,如 阅读全文
posted @ 2019-03-25 16:38 lipohong 阅读(38802) 评论(0) 推荐(1) 编辑
摘要: 区别 String s1="xxx" 与 String s2=new String("xxx") 的区别 equals() 和 == 的区别 单引号与双引号的区别 int a =(int)str.charAt(0)与int a = Integer.parseInt(str.charAt(0))区别 阅读全文
posted @ 2019-03-25 11:02 lipohong 阅读(193) 评论(0) 推荐(0) 编辑