Hi buddy, well i got that there is always a default
constructor with abstract class. OK. But why not with interface?
Thanks in advance.
Answers were Sorted based on User's Feedback
Answer / harsha
Just a samll correction... Interfaces are part of
inheritance tree.
Inheritance is identified by both extends and implements
keywords.
Regarding the default constructor.. All the classes which
extend Object class will have a default constructor.
As we all know any interface cant extend Object class..
Interface cannot have default constructor.
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / madhu
yes it is bcz interfaces are not part of the inheritance tree.
after all u can define a contract between 2 different parties
using interfaces nothing more u can expect. its not actually
an executable construct
| Is This Answer Correct ? | 2 Yes | 0 No |
abstract class Demo { public void show() { System.out.println("Hello I am In show method of Abstract class"); } } class Sample extends Demo { public void show() { super.show(); System.out.println("Hello I am In Sample "); } } public class Test { public static void main(String[] args) { //I WANT TO CALL THE METHOD OF BASE CLASS IT IS POSSIBLE OR NOT CAN WE USE SCOPE RESOLUTION OPERATOR TO CALL OR JAVA NOT SUPPORTED THAT :: OPERATORE } }
What is the difference between static and global variables and also define what are volatile variables?
0 Answers Flextronics, Hexaware,
Is java an ide?
What is "Java Native Interface" and how to use it?
When should I use abstract classes and when should I use interfaces?
What is string and example?
What is the java project architecture?
What does nullpointerexception mean?
without using arthematic operation ,how can you write the logic for adding/substraction/multiplication?
7 Answers Tanla Solutions, Wipro,
What are Normalization Rules? Define Normalization?
What is object in java?
What is <> used for in java?