can any one tell me when do u go for inheritance and
polymorphism
Answer Posted / ganesh
Inheritance :
If you want to reuse the existing class
characteristics(methods,variables ..) then you will use
inheritance ..
Polymorphism :
If you want a method to respond based on our requirement
then we will use polymorphism ..for example like swapping
two variables is same for all types but if write program
means for different types(int,double,char..) u need to write
different methods but under a common method name..
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What’s the difference between callable and runnable?
Explain OOPs concept.
What is another word for methodology?
What is a numeric string?
How do you format in java?
What is sorting in java?
what is the swingutilities.invokelater(runnable) method for? : Java thread
What is the technique adopted to create an immutable class?
How list contains works in java?
How is a variable stored in memory?
describe synchronization in respect to multithreading? : Java thread
What does bitwise or mean?
How many bytes is string in java?
What is parsing a string?
What is == in java?