java- abstract, final keyword, thows keyword

Abstract classes: a class does not have enough information to describe a particular object.
Syntax: public abstract class {} class name
characteristics abstract class:
1, certain abstract method in an abstract class.
2, abstract methods and classes must be modified abstract keyword.
3, can not be created with new abstract classes and instantiated objects. Because the abstract class itself is incomplete.
4, an abstract class abstract method to be used, after all abstract methods must be overwritten by subclasses, create sub-class object calls.
Abstract class constructors, a parent class is an abstract class, subclass provided to give an example of initialization.
 
The final modifier:
final is labeled Java keyword final composition having the features of the final state, represents the final mean
Java may be modified in the final modifier classes, methods, variables may be modified
modified with a final class can not be inherited
by final modified method non-rewritable
modified with final variables can only be assigned at most once immutable values
 
throws Keywords:
all kinds of java language keyword throws a statement will throw an exception. can simultaneously a plurality of throws exception statement, separated by commas.
Capture throws usually not indicated abnormality, the abnormality information may be automatically thrown all captured superior method;

Guess you like

Origin www.cnblogs.com/wwmmyy/p/11693726.html