============ Problem Description ============
The programming foundation is not very good ... I know there's an interface, but it doesn't work. To find a simple example ....
Normal Android programming time, such as button click event ... It is necessary to implement Onclicklistener interface ...
Private class Listent implements onclicklistener{@Overridepublic void OnClick (View v) {This interface will have a parameter V, which is the click event of the Control}}
I would like to follow the example above, the test class inside the definition of an interface See,see interface has a show (String info) .... The info inside this show method is the value of the member variable MSG in the class test.
PUBILC test{Private String msg;//is this class an abstract class? Can there be other functions implemented, such as Test_namepublic void Test_name () {log.i ("AAA", "Success");} How do I get the interface? public interface See {void showinfo (String info); }}
Then I use this class later, when the new class will implement this interface, according to the Showinfo info value to do other things
Private class Listent implements see{@Overridepublic void Showinfo (String info) {//Do other things}};//there's no way to use test_name in the class. Method?
============ Solution 1============
This is not an abstract class that allows implementations of other functions.
How Java Android implements the interface definition