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. Thank you , concept of static is clearly explained
View Tutorial          By: Jagan at 2012-12-10 10:42:42

2. thank u so much.
View Tutorial          By: sai at 2012-07-09 10:49:33

3. if done all the steps but i have found out this er
View Tutorial          By: hisham at 2010-11-24 11:01:54

4. hiiiiiii

it's good turotiral for s

View Tutorial          By: Raju Singh at 2009-10-01 09:47:04

5. Hi you will run this program just as you run any o
View Tutorial          By: Steven at 2008-10-14 09:03:28

6. how to display images in j2me?? thank you :)
View Tutorial          By: bill at 2011-06-23 23:59:41

7. Thanks for this article.
View Tutorial          By: Arindam Dey at 2011-06-16 05:23:17

8. this is genius.
you are a master of recursi

View Tutorial          By: Chandler at 2010-03-26 09:56:08

9. I want to send a message using mobile browser to s
View Tutorial          By: Richa Bhatia at 2009-12-08 22:33:36

10. Very precise and informative tutorial. Appreciated
View Tutorial          By: Rishi Raj at 2011-07-08 12:25:04