Learning Java fifth week

Through this period of study found that although Java and C ++ objects are oriented programming language, there are similarities but also differences, similarities feeling always easy to accept, except some knowledge or a new contact is not well understood and master.

Some time ago to learn the inner classes and interfaces is the case. Different is the internal class inner class and normal class is defined inside the class class ,, as well as anonymous inner classes, inheritance inner classes (inner classes need to use an external reference to the class, you need to inherit an inner class, inner classes to solve external references corresponding class initialization problem), the internal static class (class arranged inside the static properties, characteristics of the lost reference points outside the class, this class is not necessary to store a single file, but it is generally located outside the class use. and it can be obtained directly with an external + internal class name class name).

Last week found that the content is not very good grasp interface, Recalling once, found it difficult to understand in some places, very abstract, simply, to know that the interface is a special kind of abstract class, but only a prototype method, not committed implementation of the method, and in the interface can have constant and abstract method, there is not a variable, and initialization block constructor. After defining an interface that any class can go to implement this interface. By defining the interface, the interface, multiple interfaces to achieve, citing examples such as interfaces and deepen the understanding of what the interface.

 

Guess you like

Origin www.cnblogs.com/ywqtro/p/11297121.html