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 very nice
View Tutorial          By: keerthi at 2012-06-28 17:04:36

2. actually very good site. I learned more & more
View Tutorial          By: shiranthi at 2012-07-12 12:18:38

3. It works great,
my code looks like this:
View Tutorial          By: Anonymous at 2009-04-11 04:19:28

4. i have created a UI in swing now i want to read th
View Tutorial          By: Ashish Gaurkhede at 2014-09-08 08:21:04

5. HELP! HELP! HELP!
i got an time out at step

View Tutorial          By: sumit at 2009-04-03 20:19:51

6. Thank you......... It's very helpful.
View Tutorial          By: Ramesh Kumar Mahto at 2010-09-01 12:12:30

7. OK 0
COM1
javax.comm.CommPortIdenti

View Tutorial          By: sruthi at 2013-01-20 10:37:41

8. thanks becase i am very confuse what is work how t
View Tutorial          By: arvind at 2011-01-09 14:41:42

9. @All

You need to first keep your .w

View Tutorial          By: Nithya at 2011-08-31 02:27:48

10. this is a site site for our problem to be sorted o
View Tutorial          By: Atique at 2009-11-02 00:15:18