Comment on Tutorial - Abstract classes in Java By Kamini



Comment Added by : zishan

Comment Added at : 2010-05-20 00:21:46

Comment on Tutorial : Abstract classes in Java By Kamini
that was gud example to explain abstract. i have doubt.....
here is one program which has 1 abstract class without abstract method. its also works fine.
Then what the use of abstract class, any how it does not allow to create objects, we can use this with concrete class to implement method defined in abstract class which we have to extend the abstract class then why not directly in concrete class why need of abstract class.
can anyone explain this point. mail me plz
[email protected]

abstract class demo {
public void show() {
System.out.println("not abstract method");
}
// public abstract void display();
}
class demo1 extends demo {
public void display() {
System.out.println("abstract method");
}}

class program {
public static void main(String args[]) {
demo d = new demo1();
d.show();
d.display();
//d.display1();
}
}


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. Nice explanation!!!!!!! thank you
View Tutorial          By: Dinesh at 2013-07-21 10:33:30

2. How would you use a switch statement to determine
View Tutorial          By: Shivak at 2013-09-27 01:48:41

3. Thank you for your help !
View Tutorial          By: vadym at 2010-03-03 06:35:01

4. I 've tried the program for Bubble Sort. This prog
View Tutorial          By: Siva at 2012-04-17 05:19:28

5. You can also include a hidden field of the same na
View Tutorial          By: Stray at 2010-01-05 08:07:47

6. thanks a lot man....
View Tutorial          By: Praveen at 2012-12-03 08:36:51

7. Gooooooooooodd !!!
View Tutorial          By: Digvijoyee at 2010-08-30 22:11:31

8. Thanks this page is very useful for me and now I k
View Tutorial          By: Yee Wai Wyne at 2009-10-18 23:03:41

9. hi i want to run a c program in java program but i
View Tutorial          By: jyothi at 2014-11-27 06:40:27

10. A good short article on Struts. Require a step by
View Tutorial          By: Atul Saxena at 2012-01-09 19:56:59