摘要: 操作量较少时 使用String 不可变 多线程且数据量较大 使用StringBuffer 可变长 效率低 安全 单线程且数据量较大 使用StringBuilder 可变长 效率高 不安全 阅读全文
posted @ 2022-05-23 23:38 liulangde 阅读(20) 评论(0) 推荐(0)
摘要: 自定义异常 继承Exception类 处理运行时异常时,采用逻辑去合理规避同时辅助try catch处理 在多重catch块后面,可以加一个catch(Exception)来处理可能会被遗漏的异常 对于不确定的代码,也可以加上try catch 尽量处理异常,不要只用自动生成的printStackT 阅读全文
posted @ 2022-05-23 23:22 liulangde 阅读(10) 评论(0) 推荐(0)
摘要: 最高等级throwable throwable下面是error和exception try catch finally throw throws 方法名后面用throws 方法内部手动抛出异常用throw finally中代码一定执行 阅读全文
posted @ 2022-05-23 21:53 liulangde 阅读(23) 评论(0) 推荐(0)
摘要: 错误error 异常exception 阅读全文
posted @ 2022-05-23 00:56 liulangde 阅读(9) 评论(0) 推荐(0)