1:What's the difference between Interface and Abstract Class?
Answer:
i.similarity:
a)can not be instance
ii.Difference:
a) InterFace want to show the "like a " relation
b) Abstarct Class want to show the "is a" relation
2.Public/Private/Protected/Default?
Answer:
the difference is about the "access authority "
pubilc:the largest access authority
private:can be access or visible by itself
protected:can be access or visible by the subclasses or the other classes in same package
default:can be ... in same package
3.the distinction of "==" and "equals"
Answer:
i.similarity:
a)can not be instance
ii.Difference:
a) InterFace want to show the "like a " relation
b) Abstarct Class want to show the "is a" relation
2.Public/Private/Protected/Default?
Answer:
the difference is about the "access authority "
pubilc:the largest access authority
private:can be access or visible by itself
protected:can be access or visible by the subclasses or the other classes in same package
default:can be ... in same package
3.the distinction of "==" and "equals"
本文主要探讨了接口和抽象类之间的区别,包括它们所展示的不同关系类型:接口体现的是像一个的关系,而抽象类则体现了是一个的关系。此外,文章还解释了public、private、protected和default修饰符的访问权限范围以及==和equals方法的区别。
775

被折叠的 条评论
为什么被折叠?



