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                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
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
 
how exactly garbage collection take place?  4
How will you override default serialization mechanism in java  1
By what default value is an object reference declared as an instance variable? Wipro1
System.out.println(101/14) what is the output? a)6 b)14 c)7.14 d)0 Accenture6
What is user defined exception?  4
What is Collection interface? Zensar1
What are the advantages of the model over the event- inheritance model?  1
printstream class method println() is calling using System class and its static object out .how it is explain any one in detail with example ? TCS1
What is a stream? what are the different types and classes of Streams?  2
What happens when a main method is declared as private? Sun-Microsystems8
why the abstract class has default constructor?  1
Difference between overloading and Overriding. <Giving a confusing example to test the concept.> (also asked in PA Consultancy Group,iflex,Value chain,IBM,CTS,Accenture, Tarang> Symphony6
I have a sorting issue with a Hashmap. My constraint is that I MUST use the Hashmap and work with existing code. I do a database query and place the results in a Hashmap. When I iterate thru the Hashmap, it loses the original alphabetical sorting done by the database. So, my problem is that I must sort the results coming out of the Hashmap which is then placed into another class.  1
Can you explain the difference b/n abtract and interface with a good example,?In what cases we have use abtract and what case interface? Satyam1
what is sendredirect? TCS3
What is the specification of ?CODEBASE? in an applet?  1
What JNDI(Java Naming and Directory Interface) provides?  4
how can you retrive information from database by using hashmap/arraylist ,plz explain with example briefly? Satyam1
can u give one sinario when you use Abstract Class and When you use Interface. ITC-Infotech5
Which Math method is used to calculate the absolute value of a number? Accenture3
 
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