⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 java320_1.java

📁 项目实战
💻 JAVA
字号:
abstract class a{
	float obj;
    a(float obj1){
		obj=obj1;
	}			 
	abstract void add();
}
class b extends a{
	b(float obj1){
		super(obj1);
	}
	void add(){
		System.out.println();
		System.out.println("从华氏温度到摄氏温度的转换");
		System.out.println("**************************");
		System.out.println("华氏温度:"+obj);
		System.out.println("摄氏温度:"+(obj*9/5+32));
		System.out.println();
	}
	
}
class c extends a{
	c(float obj1){
		super(obj1);
	}
	void add(){
		System.out.println("从摄氏温度到华氏温度的转换");
		System.out.println("**************************");	
		System.out.println("摄氏温度:"+obj);
		System.out.println("华氏温度:"+(obj-32)*5/9);
		System.out.println();
	}
}
class d{
	public static void main(String[] args){
	b numobj=new b(100);
	numobj.add();
	c obj=new c(98.6f);
	obj.add();	
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -