Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

There are 2 methods in a class. Both have the same method
signature except for return types. Is this overloading or
overriding or what is it?

Answer Posted / shamsherabanu

It is not overloading because overloading must have different parameters, no matter what ever may be the return type is.
And for overriding inheritance should be used between 2 classes.
so it is neither overriding nor overloading.

It just show compilation error as method is already defined in
same class

Is This Answer Correct ?    12 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How does map works in java?

948


Differences between external iteration and internal iteration?

1101


Why lambda expression is used in java?

1006


5 Coding best practices you learned in java?

989


What is scope & storage allocation of static, local and register variables? Explain with an example.

973


What is a qualifier in a sentence?

949


What are different types of encoding?

1039


Which variables are stored in stack?

869


What are different types of expressions?

1066


What is supplier in java?

965


Is integer passed by reference in java?

982


Garbage collection in java?

963


What's the purpose of using break in each case of switch statement?

948


Why hashset is used in java?

1021


How to compare strings in java?

935