摘要:
## demo1 toString ``` class Person {} public class HelloWorld { public static void main(String args[]){ Person per = new Person(); System.out.println( 阅读全文
posted @ 2023-06-08 17:27
盘思动
阅读(13)
评论(0)
推荐(0)
摘要:
* class Person {} 和 class Person extends Object 是一样的。前面 extends Object被省略了 * 如果一个程序的方法要求可以接收所有类对象的时候,就可以利用Object类实现。 ## demo1 ``` class Person { } pub 阅读全文
posted @ 2023-06-08 16:46
盘思动
阅读(15)
评论(0)
推荐(0)
摘要:
## demo1 ``` class Person { public void run(){ System.out.println("run....."); } } class Superman extends Person { public void fly(){ System.out.print 阅读全文
posted @ 2023-06-08 16:12
盘思动
阅读(9)
评论(0)
推荐(0)
摘要:
### demo1 * 在向下转型之前,必须先向上转型 ``` class Person { public void run(){ System.out.println("run....."); } } class Superman extends Person { public void fly( 阅读全文
posted @ 2023-06-08 10:52
盘思动
阅读(11)
评论(0)
推荐(0)