cynchanpin

View Post

java编程思想第四版第9章

练习3:

public   class  MainTest {  
       
    public static void main(String args[]){
    	Bcycle b=new Bcycle();
    	b.print();
    }
    /**
     * 输出:
     * --Bcycle-------47
     * ----print-----47
     */
    
    public static void p(String str){};
}  

abstract class Cycle{
	public abstract void print();
}
class Bcycle extends Cycle{
	
	private int i=47;
	
	public Bcycle(){
		System.out.println("--Bcycle-------"+i);		
	}

	@Override
	public void print() {
		System.out.println("----print-----"+i);
	}
	
}


分类:

技术点:

相关文章:

  • 2022-02-10
  • 2021-11-23
  • 2021-11-20
  • 2022-01-27
  • 2022-02-10
  • 2022-02-10
  • 2022-02-10
猜你喜欢
  • 2021-12-19
  • 2022-02-10
  • 2022-02-10
  • 2022-02-10
  • 2021-08-31
  • 2021-06-08
  • 2022-02-10
相关资源
相似解决方案