GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Placement Papers  >  Oracle  >  Java
Go To First  |  Previous Question  |  Next Question 
 Java  |  Question 133 of 134    Print  
what will be the return type of the below overloaded method

public void example(int x) {

a) int
b) char
c) short

  
Total Answers and Comments: 4 Last Update: May 07, 2008     Asked by: S.N.Prasath 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: Sunil
 
One can overload the methods, only by 1. Change in number of arguments.2. Change in type of arguments.And NOT on return type. Hence in the above case, you cannot overload "example(int x)" method by changing its return type

Above answer was rated as good by the following members:
kumpsath
August 28, 2006 05:24:44   #1  
Manoj Kumar        

RE: what will be the return type of the below overload...
Overloaded methods does not concern with the return type there is signature of the methods should be different
 
Is this answer useful? Yes | No
September 25, 2006 04:35:40   #2  
Sunil        

RE: what will be the return type of the below overload...
One can overload the methods only by 1. Change in number of arguments.2. Change in type of arguments.And NOT on return type. Hence in the above case you cannot overload example(int x) method by changing its return type
 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
January 05, 2007 01:19:33   #3  
shaik        

RE: what will be the return type of the below overload...
Overloading never concerns with return type. Even if the method void example(int x) is overloaded with different parameters and no. of parameters the return type is same i.e void mean nothing it is returning.

 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
May 07, 2008 05:36:00   #4  
tiger24 Member Since: April 2008   Contribution: 1    

RE: what will be the return type of the below overloaded methodpublic void example(int x) {a) int b) charc) short


A void return type indicates that a method does not return a value.


 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape