Java的回调

package com.dlt.test;

public class TestBase {

	public void test(){
		System.out.println("aa");
		bb();
		System.out.println("cc");
	}
	
	public void bb(){
		
		
	}
}

package com.dlt.test;

public class TestExtend extends TestBase{
	public void bb(){
		System.out.println("bb");
	}

	public static void main(String[] args){
		TestExtend te = new TestExtend();
		te.test();
	}
}

你可能感兴趣的:(JAVA)