![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Java 基础
tom-blog
hardly studying make a better life.
do what you love.
every step is an important step.
展开
-
try catch finally 有return的执行顺序
try catch 中有return的时候,finally 的代码一定会执行 测试代码: public class FinallyReturnDemo { public static void main(String[] args) { try{ System.out.println(1); return ; }catch(Exception e)原创 2017-02-19 11:13:30 · 341 阅读 · 0 评论 -
Java 继承接口同名函数问题
在Java中如果一个类同时继承接口A与B,并且这两个接口中具有同名方法,会怎么样? 动手做实验: interface A{ void fun(); } interface B{ void fun(); } interface C extends A,B{ } public class Test implements C{ @Override原创 2017-02-19 11:42:19 · 4368 阅读 · 0 评论 -
去除字符中非中文、数字、字母
StringBuilder builder=new StringBuilder(); for (int i=0;ilength();i++){ char ch= newName.charAt(i); if(ch>='0'&&ch'9'||ch>='a'&&ch'z'||ch>='A'&&ch'Z'|| ch >= 0x4E00 && ch 0x9FA5) builde原创 2018-01-25 19:44:32 · 946 阅读 · 0 评论