ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE
Google
 
Categories  >>  Software  >>  Core Java  >>  Java J2EE  >>  Java Related
 
 


 

 
 Core Java interview questions  Core Java Interview Questions
 Advanced Java interview questions  Advanced Java Interview Questions
 Swing interview questions  Swing Interview Questions
 EJB interview questions  EJB Interview Questions
 Servlets interview questions  Servlets Interview Questions
 Struts interview questions  Struts Interview Questions
 JDBC interview questions  JDBC Interview Questions
 JMS interview questions  JMS Interview Questions
 SunOne interview questions  SunOne Interview Questions
 J2EE interview questions  J2EE Interview Questions
 Weblogic interview questions  Weblogic Interview Questions
 Websphere interview questions  Websphere Interview Questions
 Java Networking interview questions  Java Networking Interview Questions
 Java J2EE AllOther interview questions  Java J2EE AllOther Interview Questions
Question
IS method overriding is Duplication of Methods?
 Question Submitted By :: Sonali.nalawade
I also faced this Question!!     Rank Answer Posted By  
 
  Re: IS method overriding is Duplication of Methods?
Answer
# 1
No. In method overriding the behaviour of overrided method 
is different. The subclass override only those methods, 
which has different behaviour than superclass else alawys 
use all the methods of superclass, which is better than 
making a lot duplication by defining another class for same 
methods of superclass.
 
Is This Answer Correct ?    9 Yes 0 No
Amol
 
  Re: IS method overriding is Duplication of Methods?
Answer
# 2
yes
 
Is This Answer Correct ?    0 Yes 5 No
Guest
 
 
 
  Re: IS method overriding is Duplication of Methods?
Answer
# 3
No.In subclass we will extend the functionality of super
class method.
 
Is This Answer Correct ?    2 Yes 0 No
Naveen Kumar Raavi
 
  Re: IS method overriding is Duplication of Methods?
Answer
# 4
To understand the Question, one needs to know the scenarios 
where in a method is overriden.
there are two cases:
you want to override a method:
1)when the super class doesnt know how to implement it, and 
leaves the implementation to the sub-class.
2)when the subclass feels, it has to add few more details 
specific to itself than which are provided by the 
superclass.

so there is no duplication happening provided one overrides 
a method sensibly(understanding thorougly if overriding a 
method is necessary or not).if one wishes to write things 
that are already available, it is then called "duplication 
of code",
 
Is This Answer Correct ?    2 Yes 0 No
Venkat
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
Hi ,i convert contrller as jSp And presentation as servlet ...will it do? if so what are advantage and idsadvantages IBM1
Explain the differences between public, private, protected and static?  3
what's diff between struts 1.1 & 1.2 Wipro2
Write program to print Hello World and print each character address in that string and print how many times each character is in that string? Ex: H: 0 & 1 e:1 & 1 l :2,3,8 & 3 o:4,6 & 2 w:5 & 1 r: 7 & 1 d 9 & 1 Huawei3
what is servlet filter?  1
What is the difference between Abstract Class and Interface AMDOC6
What is the need of "creating and throwing an UserdefinedException" when the "Exception" class is already available?  4
We have two methods to create methods the threads. 1. Implementing runnable interface 2. Extending to thread class and overriding run method. Among these two which one is better and why? Please explain me in detail.  2
what is mean by method signature? Satyam5
Hai all I want to print given array in reverse order Ex: int a[]={1,2,3,4,5};display this array in reverse order.  2
Given: 11. public static void main(String[] args) { 12. Integer i = uew Integer(1) + new Integer(2); 13. switch(i) { 14. case 3: System.out.println(”three”); break; 15. default: System.out.println(”other”); break; 16. } 17. } ‘What is the result? 1 three 2 other 3 An exception is thrown at runtime. 4 Compilation fails because of an error on line 12.  2
What is 'finally' method in Exceptions?  4
EDS (Electronic Data Systems India Pvt Ltd) at Chennai on 16-12-2006. EDS1
what is unreachable code problem in multiple catch statements  2
Can a lock be acquired on a class?  2
Why Wait and notify are kept in Object class although they are used only with Thread Class Saksoft2
I have a Person object with 5 variables and I want to store them in a file called Person.txt. What should I do? KPIT3
When we will use an Interface and Abstract class?  3
StringBuilder s = new StringBuilder("Hello Mom");s.append(",I mean,Mother"); Response.Write(s.ToString()); String s = "Hello Mom"; s+ = ",I mean Mom"; Response.Write(s); Which is faster ? which uses the most memory?  4
how many ways we can serialize the java object? Satyam1
 
For more Core Java Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com