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                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
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
Explain method overloading and overriding?
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Explain method overloading and overriding?
Answer
# 1
Method overloading: when a method in a class having the 
same method name with different arguments is said to be 
method overloading.
Method Overridding: when a method in a class having the 
same method name with same arguments is said to be method 
overridding.
 
Is This Answer Correct ?    10 Yes 2 No
Janet
 
  Re: Explain method overloading and overriding?
Answer
# 2
Method overloading: when a method in a class having the 
same method name with different number/type of arguments 
with the existense of prevoius meaning also is called 
method overloading.
Method Overridding: when a method in a class having the 
same method name with same number & type of argument(s) 
however there mus not be any existense of previous meaning 
is said to be method 
overridding.
 
Is This Answer Correct ?    5 Yes 1 No
Chittaranjan
 
 
 
  Re: Explain method overloading and overriding?
Answer
# 3
when we use method in a class hane same name with different 
arguments are calles method overloading
when we use methodes with same class name and same 
arguments called ovverriding
 
Is This Answer Correct ?    4 Yes 2 No
Prasad
 
  Re: Explain method overloading and overriding?
Answer
# 4
overloading:previous answers are correct.
overriding: overriding is possible only in inheritance.
 we will have more than one methods in the same name with 
same no. of arguments with same type in different classes.
 
Is This Answer Correct ?    5 Yes 2 No
Aburar Yaseen
 
  Re: Explain method overloading and overriding?
Answer
# 5
method overloading is the type of polymorphism with a
different argument list and same method name and can takes
place inside the same class only

method overriding is the process of writing a different
functionality having the same method signature
 
Is This Answer Correct ?    3 Yes 1 No
Ravikiran(aptech Mumbai)
 
  Re: Explain method overloading and overriding?
Answer
# 6
Method overloading happens in class with same method name but by modifying below features
1> By changing number of parameters 
2> By changing ordinal position of parameter , i mean to say here is by changing datatype place.
And method overriding happens in two or more than two class , i mean defining same method declaration without any modification within two class and among of that two class , one class must extend another class and further also you can override this method , and this procedure continues till one subclass leaves overriding this method.
 
Is This Answer Correct ?    1 Yes 0 No
Priyabrata Patro
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
Java support what type of parameter passing ? Wipro6
What are order of precedence and associativity, and how are they used?  1
Why cant we define System.out.println() inside a class directly?  4
How to add two numbers with out using Arithmetic , union operators in java....? But we can use bitwise operators... but how...? CTS2
What is advantage of using threads? BMC2
what is ennumaration? AMDOC1
How to deprecate a method? Show it with proper example. Plz give the answer of this.Thanx in advance. mail me: tanzeem.akhtar@gmail.com  1
What is the difference between getCodeBase and getDocumentBase methods?  1
what is multithreading? Virtusa4
what is an object and how do you allocate memory to it? Wipro3
what is the use/perpose of having a method antive?  2
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
how do you store phone numbers using java collections Bosch4
33. try { 34. // some code here 35. } catch (NullPointerException e1) { 36. System.out.print(”a”); 37. } catch (RuntimeException e2) { 38. System.out.print(”b”); 39. } finally { 40. System.out.print(”c”); 41. } What is the result if a NullPointerException occurs on line 34? 1 c 2 a 3 ab 4 ac  2
what is difference between class and object?  11
What is the % operator?  2
Program to find greatest prime number in n numbers? Huawei3
what is the difference between abstract class and Interface?where we can use it in realtime projects? Logica-CMG10
If set accepts only one argument then how can it compare two objects to avoid duplicates  3
what is real-time example of runtime polymorphism and compile time polymorphism  1
 
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