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



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. Very easy and simple to understand....good article
View Tutorial          By: Ashish at 2009-10-07 00:58:08

2. thanx very much...
View Tutorial          By: Rajesh at 2015-10-09 08:57:36

3. Abstract class example is good, What is the differ
View Tutorial          By: megakumar at 2011-04-10 04:15:10

4. Hello Friends, i am getting an error in following
View Tutorial          By: Albin at 2008-07-10 23:49:33

5. why have you change first name oak to java ?
View Tutorial          By: manohar patil at 2014-08-20 03:44:23

6. thanks for your code
could you send me the

View Tutorial          By: nocturne at 2009-01-09 01:57:05

7. Hi everybody,
cn u plz mail me the working

View Tutorial          By: Srijita at 2011-11-28 06:10:03

8. better..................
implements........

View Tutorial          By: sunny at 2012-01-04 17:30:12

9. Only first row is exported, help to export all the
View Tutorial          By: Achyut at 2014-12-18 04:26:26

10. Hi Fred, I found this link which has more explanat
View Tutorial          By: Boulvat at 2012-09-25 08:36:48