Java?????????÷?
???????????? ???????[ 2017/4/5 10:57:16 ] ??????????????????? Java
????Java??????????÷???????????????г???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????Щ????????????????????????????
??????????y???????????????????????????????????????????????翪???????
???????????????????Java???????У?????????????????????????????в?????????????????????
??????????????????????????????????????????????????????????????????????????????к??????????????????????
?????????????????????????????javaд???????android????
????1??????÷?
????????????Main??????????InterfaceExample
????public class Main implements InterfaceExample{
????public static void main(String[] args) {
????System.out.println("------?????ò???--------");
????InterfaceTest test = new InterfaceTest();
????//????InterfaceTest??handleThings????????????Main?????
????test.handleThings(new Main());
????System.out.println("------?????????--------");
????}
????@Override //??д??????
????public void sendMessage(String string) {
????System.out.println("?????????????? " + string + " ???Щ??");
????}
????}
????//????????д???????????.java?????
????interface InterfaceExample {
????void sendMessage(String string);
????}
?????????????????????InterfaceTest
????public class InterfaceTest {
????//???????Main???????????????????????Main???
????public void handleThings(InterfaceExample example) {
????new Thread(new Runnable() {
????@Override
????public void run() {
????System.out.println("-----???Щ??------");
????try {
????Thread.sleep(3000);
????} catch (InterruptedException e) {
????e.printStackTrace();
????}
????//?????????
????example.sendMessage("?????????");
????}
????}).start();
????}
????}
???????????????
????------?????ò???--------
????------?????????--------
????-----???Щ??------
?????????????????? ????????? ???Щ??
??????????????????????Main?е???handleThings????С?
????2?????????????????????
???????????????????????????????Main?????
????public class Main {
????public static void main(String[] args) {
????System.out.println("------?????ò???--------");
????InterfaceTest test = new InterfaceTest();
????//????InterfaceTest??handleThings????????????????InterfaceExample?????????????
????//????????????????д??????
????test.handleThings(new InterfaceExample() {
????@Override //??д??????
????public void sendMessage(String string) {
????System.out.println("?????????????? " + string + " ???Щ??");
????}
????});
????System.out.println("------?????????--------");
????}
????}
????interface InterfaceExample {
????void sendMessage(String string);
????}
???????????????????????????????????????????????????????????????÷????????????android??????view??????????????????????л????
???????????????
????------?????ò???--------
????------?????????--------
????-----???Щ??------
?????????????????? ????????? ???Щ???
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11