Java
文章平均质量分 81
WXS_Frog
This is my personal blog, the content of this site is my own personal opinion and does not in any way represent my employer. All postes here are licensed under a Creative Commons License.You can also contact me by dhuwxs@163.com Enjoy.
展开
-
继承、重写、覆盖、重载、多态的区别
override->重写(=覆盖)、overload->重载、polymorphism -> 多态 1、继承(inheritance) 一旦你已经创建了一个定义了对象一般属性的超类,该超类可以被继承以生成特殊用途的类。每一个子类只增添它自己独特的属性。这是继承的本质。Java 不支持多超类的继承。 超类变量可以引用子类对象(这个具体有什么作用,有待补充)2、重写(覆盖)原创 2014-02-16 22:04:02 · 458 阅读 · 1 评论 -
关于Java浮点数运算精度丢失问题
前几天看了一个朋友的博客,说Java中浮点数运算精度丢失的问题,他给出了问题,也指出了C语言相对于Java的优势,其实,Java中也是可以解决浮点运算精度丢失问题的。那就是:BigDecimal。先看一段程序:public class DoubleTest{ public static void main(String args[]) { System.out.println原创 2014-02-19 10:51:14 · 1372 阅读 · 2 评论