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. send c++ programs on every topic of c++
View Tutorial          By: mandeep at 2009-07-11 00:50:23

2. it was very usefull.....thanks :)
View Tutorial          By: qwerty at 2010-04-04 05:48:07

3. Good and Effective example
thank you

View Tutorial          By: Perumal Naren at 2009-12-30 03:10:50

4. Hi..
How can i read .mp3 files from memory

View Tutorial          By: satyanarayana at 2010-03-29 11:14:27

5. i want excel file upload and stored into database
View Tutorial          By: excel file upload and genreat pdf in php at 2011-07-25 08:24:50

6. i want simple program of function used in recursio
View Tutorial          By: manish at 2009-05-19 01:03:19

7. can any beginners can try creating web pages

View Tutorial          By: jo at 2015-07-28 19:35:11

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

9. good
View Tutorial          By: Sudip Khatiwara at 2010-04-23 00:52:58

10. Really a appriciatable one. Can u plz send the cod
View Tutorial          By: Jeevan at 2009-04-11 12:39:45