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 sir, please provide me string array in d
View Tutorial          By: ravi gupta at 2012-01-17 17:04:33

2. Nothing that hasn't been said before, but I wasn't
View Tutorial          By: Calvin at 2010-03-22 20:43:10

3. i like this a lot
View Tutorial          By: raj at 2011-05-06 06:15:36

4. 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

5. can anyone tell me which type of device i need to
View Tutorial          By: dhanunjay at 2009-04-01 00:31:17

6. please am in Nigeria, i need to know how to send a
View Tutorial          By: kay at 2009-10-15 03:06:10

7. this code works very well for me , but it runs onl
View Tutorial          By: m. usman at 2013-08-31 14:17:22

8. How can I store a file in device internal memory a
View Tutorial          By: Fabio at 2014-11-20 11:25:41

9. It is throwing exception....Image is not displayin
View Tutorial          By: Aswin at 2012-02-12 08:07:41

10. really helpfull :) thanks
View Tutorial          By: Jagan at 2014-12-09 10:16:56