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. Thanks great tutorial..
View Tutorial          By: Abul Rahman at 2009-07-24 11:39:52

2. Hi, thi's sursh laveti, actually I'm getting a pro
View Tutorial          By: suresh l at 2015-06-24 07:53:19

3. I'm sorry I've misunderstood, join() guarantees th
View Tutorial          By: Junkie Zhang at 2012-01-10 06:02:00

4. Is so easy work with FacesContext. For me, the get
View Tutorial          By: Fred at 2009-03-11 08:42:59

5. Thank you for this tutorial. Thank you all the mor
View Tutorial          By: sd at 2013-09-09 05:38:52

6. Muchas gracias por compartir informacion. :)
View Tutorial          By: Anonymous at 2009-05-21 08:48:47

7. it's very good to understand...and it is helpful f
View Tutorial          By: Rakesh at 2009-12-26 00:14:59

8. PROGRAM TO FIND OUT SMALLER NU:-

cl

View Tutorial          By: ishaan gogna at 2012-05-09 19:00:49

9. Bitwise OR is a pipe (|), not a logical NOT (!)
View Tutorial          By: Martijn at 2011-06-21 10:49:29

10. Hi Maybelline, This is the <a href="http:/
View Tutorial          By: Daniel Malcolm at 2008-08-21 06:57:31