Comment on Tutorial - Abstract classes in Java By Kamini



Comment Added by : Anonymous

Comment Added at : 2012-11-16 12:23:17

Comment on Tutorial : Abstract classes in Java By Kamini
/* File name : Employee.java */
public abstract class Employee
{
  private String name;
  private String address;
  private int number;
  public Employee(String name, String address, int number)
  {
     System.out.println(\"Constructing an Employee\");
     this.name = name;
     this.address = address;
     this.number = number;
  }
  public double computePay()
  {
    System.out.println(\"Inside Employee computePay\");
    return 0.0;
  }
  public void mailCheck()
  {
     System.out.println(\"Mailing a check to \" + this.name
      + \" \" + this.address);
  }
  public String toString()
  {
     return name + \" \" + address + \" \" + number;
  }
  public String getName()
  {
     return name;
  }
  public String getAddress()
  {
     return address;
  }
  public void setAddress(String newAddress)
 {
     address = newAddress;
 }
 public int getNumber()
 {
    return number;
 }
}

you can look at this example


View Tutorial



Ask a Question

Subscribe to Tutorials

Related Tutorials

Program using concept of byte long short and int in java

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. this is the thread object and thread name
View Tutorial          By: narain at 2011-12-06 07:33:07

2. i need help in writing code for multiplication pro
View Tutorial          By: viswanath at 2013-02-23 14:13:40

3. I agree with BHAGYALAXMI. I faced the same problem
View Tutorial          By: Alok at 2010-01-10 12:03:37

4. good
View Tutorial          By: pardhuman at 2011-06-24 08:18:15

5. thanks! great tutorial!
View Tutorial          By: Gracia at 2013-01-10 07:58:06

6. what is self-executing program ? or dynamic data
View Tutorial          By: vasu at 2013-04-18 17:36:35

7. This solution worked like a charm, thank you. I ha
View Tutorial          By: budfox at 2014-07-15 14:25:16

8. grt tutorial
View Tutorial          By: sss at 2009-08-30 03:33:13

9. Very helpful tutorial for me.
Thank you for

View Tutorial          By: Mohan at 2012-05-28 00:12:56

10. how to downlow the different 5 files please !!
View Tutorial          By: Agnin at 2009-06-24 05:29:09