Java-Interface abstract class inner class anonymous class

Source: Internet
Author: User

All properties in the interface are public static final, and the methods are public. The access modifier must be either the public interface or the other interface, similar to the inheritance of the class, the keyword extends
Http://www.cnblogs.com/dolphin0520/p/3811437.html
Deep understanding of Java interfaces and abstract classes
Http://baike.baidu.com/view/2493204.htm interface-Oriented programming
An interface refers to a method or function that is invoked by others, and is an abstraction of behavior.
Inheritance is a "yes" relationship, while an interface implementation is a "no" relationship.
(This is in the chapter when looking at the container to find all with collection puzzled)
Interface callbacks refer to the ability to assign a reference to an object created with a class that implements an interface to the interface sound
Interface variable, then the interface variable can invoke the method of the interface implemented by the class. In fact, when
When an interface variable calls a method in an interface that is implemented by a class, it is the method that notifies the corresponding object to invoke the interface
, this process is called an interface callback for the object function
Cross-class references
1) If a is a reference to Class A, then a can point to an instance of Class A. Or the one that points to class A
Sub-class, which is a case of upward transformation.
2) If a is a reference to interface A, then a must point to an instance of a class that implements interface A. This is
The case of an interface callback.
An abstract method is an abstract class. or direct abstract defines abstract class abstract method after; public abstract void Func (..); Subclasses are either abstract or override abstract methods

Anonymous classes: In multithreading, you must inherit an interface or implement a parent class anonymous object: Use the direct new O () as a parameter or use its method. Http://www.cnblogs.com/nerxious/archive/2013/01/25/2876489.htmlThread tt=new Thread (New Runnable () {public void run (  {System.out.println ("in THREAD");} });
Inner class http://www.cnblogs.com/nerxious/archive/2013/01/24/2875649.html
An anonymous inner class is a special local inner class that implements an interface through an anonymous class.
IA is defined as an interface.
IA i=new ia () {};

Java-Interface abstract class inner class anonymous class

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.