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. Hi, you put a semicolon after "int main()&quo
View Tutorial          By: noel4037 at 2009-12-28 06:40:17

2. Thanks,It's perfect solution,I solved my probleam
View Tutorial          By: Suryaprakash Raghuwanshi at 2009-07-04 19:06:24

3. I changed import javax.comm.*; for this line impo
View Tutorial          By: Julen at 2010-07-18 18:39:25

4. Great work ;)
View Tutorial          By: Rizwanulla Sharieff at 2012-08-21 04:42:41

5. simple way friends:
public class palindrome

View Tutorial          By: Manoj at 2013-01-07 02:18:00

6. Your page does not show the text in the proper col
View Tutorial          By: Warron at 2013-04-04 17:50:22

7. May be someone would find this useful.


View Tutorial          By: Vsk at 2010-02-22 00:48:42

8. Very useful tutorial. But if same code is executed
View Tutorial          By: Jitendra Kumar Mahto at 2011-08-12 15:10:14

9. I can't get it untill now. I need further explaina
View Tutorial          By: johnlie at 2011-01-19 20:31:09

10. Thanks.. really helpful:)
View Tutorial          By: Dolly at 2012-07-09 14:24:30