📄 polymorphism.java
字号:
/*
* Polymorphism.java
*
* Created on 2000年9月23日, 下午7:33
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package newpackage.Test;
import java.io.*;
public class Polymorphism{
public static void main(String[] args)throws IOException{
Employee employee = null;
int option;
BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
System.out.print("1 for part-time\n2 for full-time\noption? ");
option = Integer.parseInt(buf.readLine());
switch(option){
case 1:
employee = new PartTimeEmployee();
break;
case 2:
employee = new FullTimeEmployee();
break;
default:
System.out.println("Unknown option");
}
employee.dealSalary();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -