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. hey hiii.
at last the progrma has be runnin

View Tutorial          By: jugal at 2009-02-20 08:22:31

2. "THIS IS SAMPLE EXMPLE!!!!!!!!!!11111"
View Tutorial          By: david billa at 2012-08-02 06:23:43

3. hello sir

i am simulating railway r

View Tutorial          By: karthick at 2008-08-30 03:09:42

4. Hi All........
People those who are ge

View Tutorial          By: Abhijit at 2013-05-28 11:24:24

5. Very good example .. i ve written this program . P
View Tutorial          By: gomz at 2011-09-26 12:33:54

6. Thanks Thanks Thanks.....for you
But how

View Tutorial          By: jihad at 2009-02-15 04:48:53

7. thank you..........
View Tutorial          By: ravi at 2010-01-29 23:27:39

8. hi this is very helpful........thank you very much
View Tutorial          By: sumalatha at 2010-06-07 02:16:37

9. I got the sample and the test working. Thanks a lo
View Tutorial          By: Trishul at 2009-10-26 07:32:57

10. This is probably a good java tutorial but it made
View Tutorial          By: lol at 2012-09-15 21:20:09