class form of expression
Java code 650) this.width=650; "class=" star "src=" Http://yangnier.iteye.com/images/icon_star.png "alt=" Favorite Code "style=" border:0px; "/>
Public class a{}
characteristics of the class:
1) A property in a class can be a member property, or it can be a class property
2) A method in a class must be a method that has a method body, can be a member method, or it can be a class method
3) Each class must have at least one constructor method, the default is a parameterless construction method, you can call the constructor method to create the object
A class can inherit only one parent class, one root inheritance
Java code download Span style= "color: #000000;" >  650) this.width=650; "class=" star "src=" Http://yangnier.iteye.com/images/icon_star.png "alt=" collection Code "style=" border:0px; "/
Public class a{}
Public class B extends a{}
Abstract class
form of expression:
Java code 650) this.width=650; "class=" star "src=" Http://yangnier.iteye.com/images/icon_star.png "alt=" Favorite Code "style=" border:0px; "/>
Public Abstract class a{}
features of abstract classes:
1) Properties in an abstract class, like classes, can be member properties or class properties
2) methods in an abstract class can be abstract methods or specific member methods
3) methods in an abstract class need to define access qualifiers
4) Abstract class has a constructor method, the default is a parameterless construction method, but cannot be used to create an object (that is, cannot new object)
5) Abstract class is used to act as the parent class, to inherit and extend the subclass.
A class can inherit only one abstract class
Download
interface (interface)
form of expression:
Java code 650) this.width=650; "class=" star "src=" Http://yangnier.iteye.com/images/icon_star.png "alt=" Favorite Code "style=" border:0px; "/>
Public Interface a{}
features of the interface:
1) The attribute in the interface must be a public constant (the initial value must be assigned)
2) The properties in the interface default to public static final, which must be public static final
3) The methods in the interface must all be abstract methods only
4) The method in the interface is public abstract by default and must be public abstract
5) The access qualifier of the method in the interface defaults to public, which must be public
6) The interface has no construction method and cannot create an object (that is, it cannot be a new object)
7) The interface is used to act as a parent class to extend to subclasses.
There is also an implementation of the interface:
Download
Java code 650) this.width=650; "class=" star "src=" Http://yangnier.iteye.com/images/icon_star.png "alt=" Favorite Code "style=" border:0px; "/>
Public class A implements b{}
A class can implement multiple interfaces
Java code 650) this.width=650; "class=" star "src=" Http://yangnier.iteye.com/images/icon_star.png "alt=" Favorite Code "style=" border:0px; "/>
Public interface c{}
Public interface d{}
Public class E implements c,d{}
Note: The class implements the interface and must implement all the abstract methods in the [Override] interface
cannot reduce the visible range of a method when overriding inherited methods/implementing methods in an interface
A class can inherit a class first, and then implement multiple interfaces
Java code 650) this.width=650; "class=" star "src=" Http://yangnier.iteye.com/images/icon_star.png "alt=" Favorite Code "style=" border:0px; "/>
Public class F extends A implements c,d{}
Summary of abstract classes and interfaces