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. its is good..I am developing a Form based applicat
View Tutorial          By: Bhavani at 2010-10-18 01:39:41

2. Good examples for beginners.
View Tutorial          By: Sagar at 2009-10-16 01:04:46

3. simply nice.. Thank you.
View Tutorial          By: Anil at 2011-11-30 06:36:23

4. class Evaluate
{
public static void

View Tutorial          By: prajjawal at 2013-02-27 12:36:58

5. M finding difficulty in understanding Java. Can an
View Tutorial          By: Sunil at 2010-09-28 03:54:57

6. Thank you very much for this tip.
View Tutorial          By: Lise at 2011-07-15 13:27:23

7. Actually, the given accuracy just barely exceeds w
View Tutorial          By: William Fraser at 2015-06-07 16:37:52

8. hi can u send me the complete working code for sen
View Tutorial          By: Amit Adhikaree at 2011-03-22 17:47:49

9. ma'am aiza teaches us very well.. >< i like
View Tutorial          By: chai at 2011-02-07 07:06:36

10. can i ask question? on how to make a statement by
View Tutorial          By: alas at 2012-09-27 00:42:08