java
南阳隐鹤
I am a android developer
展开
-
Java父类和子类的关系
写这篇博客的目的是因为在Android开发中我们经常要和基类(BaseActivity)打交道,但是付类和字类的关系你真的清楚吗?代码很简单先上一个父类 public class Parent { public Parent() { super(); System.out.println(" 调用父类的无参数的构造函数 "); } public Parent(String name) { super(); this.name = name; System.out.println(" 调原创 2020-05-30 10:57:53 · 332 阅读 · 0 评论 -
Java基础----你真的了解java类创建顺序吗?
public class HelloParent { helloY y = new helloY(); static { System.out.println(“parent static block”); } HelloParent() { System.out.println(“parent construct”); ...原创 2018-06-09 10:51:38 · 316 阅读 · 0 评论