A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
JavaRanch
»
Java Forums
»
Java
»
Beginning Java
Author
Overloading Example doubt
ashok bantu
Greenhorn
Joined: Jan 30, 2009
Posts: 10
posted
Jul 25, 2011 05:08:35
0
class A{ public void f1(String s){ System.out.println("String"); } public void f1(Object obj){ System.out.println("Object"); } public static void main(String args[]){ A a = new A() a.f1(null); } }
Guys,
What is out put of the above program and Why?
Devaka Cooray
Saloon Keeper
Joined: Jul 29, 2008
Posts: 2691
3
I like...
posted
Jul 25, 2011 05:12:17
0
ashok bantu wrote:
What is out put of the above program... ?
What happened when you tried it?
Author of ExamLab (
Download
) - the free mock exam kit for SCJP / OCPJP
Home Page
--
Twitter Profile
--
JavaRanch FAQ
--
How to Ask a Question
ashok bantu
Greenhorn
Joined: Jan 30, 2009
Posts: 10
posted
Jul 25, 2011 05:14:55
0
it is giving the
String
as output .What is concept behind this
Devaka Cooray
Saloon Keeper
Joined: Jul 29, 2008
Posts: 2691
3
I like...
posted
Jul 25, 2011 05:40:36
0
This question has been answered many times in this forum
I found
this one
from a little search.
I agree. Here's the link:
jrebel
subject: Overloading Example doubt
Similar Threads
Passing References
Interface implementation issue
can u give the ans!!!!!!!!
Question about equals! help
what is the out put of this program ? why ?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter