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

📄 hourlyemployee2.java

📁 Java接口
💻 JAVA
字号:
//带接口的HourlyEmployee


import javax.swing.JOptionPane;

public class HourlyEmployee2 extends EmployeeBase implements Security
{	
	protected double hourlyRate;
	protected int hoursWorked;
 
	
	public HourlyEmployee2()
	{
		System.out.println("这是HourlyEmployee的构造器。");
		}  
	
    	
	public void setHourlyRate(double temp)
	{
		hourlyRate=temp;
		}
	
	public double getHourlyRate()
	{
		return hourlyRate;
		}
		
	public void setHoursWorked(int temp)
	{
		hoursWorked=temp;
		}
		
	public int getHoursWorked()
	{
		return hoursWorked;
		}
		
	public double getGrossPay()
	{
		grossPay=hourlyRate*hoursWorked;
		return grossPay;
		}
		
	public void display()
	{
		JOptionPane.showMessageDialog(null,"***雇员记录***\n\n"+
		     "EmployeeID:"+empID+"\n"+
		     "Name:"+name+"\n"+
		     "hourlyRate :$"+hourlyRate+"\n"+
		     "hours Worked:"+hoursWorked+"\n"+
		     "gross Pay:$"+getGrossPay());
		     }
		     
	//在调用接口的类中必须重写接口中的抽象方法!	     
    public void determineUserID()
    {
    	System.out.println("Security Interface determineUserID method");
    	}
    public void obtainPassword()
    {
    	System.out.println("Security Interface obtainPassword  method");
    	}
    	
    public void writeAuditRecord()
    {
    	System.out.println("Security Interface writeAuditRecord  method");
    	}
    
}


⌨️ 快捷键说明

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