1.重载:参数数量或者参数类型不同(overloading ):2.重写:override 关键字重写父类方法,父类的方法是virtual 或 abstract修饰的, using System; class A { //虚方法 virtual public void sayHello(){ Console.WriteLine("A sayHello"); } } class Test:A { override public void sayHello(){ base.sayHello…
1.通过@Bean(initMethod ="initPerson",destroyMethod ="destroyPerson" ) public class Person { public Person() { System.out.println("Person 初始化............"); } public void initPerson(){ System.out.println("Person ..... init&…