Extends

Extends

extends is to inherit one class to the other class. parent classes —>sub classes
If a method was called in another method and the object is from outside of the class, we just called it directly and not add xxx.xxx here.If it is from inside of a class, we will use xxx.xxx to call the inner methods.(如果在一个method里面调用另外一个method时,如果在class外面的对象时,就直接调用另外一个方法,比如:

public class RotateSLList<Blorp> extends SLList<Blorp> {
     public void rotate() {
        Blorp x = removeLast();
        addFirst(x);
     public static void main(String[] args) {
     	RotateSLList<String> Rl =  new  RotateSLList<String>();
     	RladdLast("haha);
}

Extends Inheritance: Only inherit all the members of the parents’ class.
all the members:
All instance and static variables
All methods
All nested classes
**Constructors are not inherited, private classes can not be accessed directly by subclasses **

Cast只能暂时cast

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值