This week's book giveaway is in the
Agile and other Processes
forum.
We're giving away four copies of
The Mikado Method
and have Ola Ellnestam and Daniel Brolund on-line!
See
this thread
for details.
A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
The Mikado Method
this week in the
Agile and other Processes
forum!
JavaRanch
»
Java Forums
»
Certification
»
Programmer Certification (SCJP/OCPJP)
Author
Self Test doubt
saloni jhanwar
Ranch Hand
Joined: Feb 09, 2012
Posts: 583
I like...
posted
Apr 17, 2012 03:26:53
0
class A{} class B extends A{} public class ComingThru { static String s="-"; public static void main(String[] args) { A[] aa=new A[2]; B[] ba=new B[2]; sifter(aa); sifter(ba); sifter(7); System.out.println(s); } static void sifter(A[]... a2){ s+="1";}; static void sifter(B[]... b1){ s+="2";}; static void sifter(B[] b1) { s+="3";}; static void sifter(Object o) { s+="4";}; }
Here answer in book is -434 but i think it should be -424
Tell the difficulties that i am difficult.
Matthew Brown
Bartender
Joined: Apr 06, 2010
Posts: 3793
1
I like...
posted
Apr 17, 2012 03:28:52
1
Remember var-args always get the the lowest priority when matching methods.
saloni jhanwar
Ranch Hand
Joined: Feb 09, 2012
Posts: 583
I like...
posted
Apr 17, 2012 03:32:53
0
Matthew Brown wrote:
Remember var-args always get the the lowest priority when matching methods.
Thanks Metthew
saloni jhanwar
Ranch Hand
Joined: Feb 09, 2012
Posts: 583
I like...
posted
Apr 17, 2012 06:48:35
0
DJ
Sagar Rohankar
I agree. Here's the link:
http://aspose.com/file-tools
subject: Self Test doubt
Similar Threads
Study Guide 6 -- Chapter2 Self Test Question 15 on page 181.
SCJP 1.6 Chapter2 Question 15- Answer -> is D ,I think it should be E
kathy sierra self test question..???
Which overloaded method is called?
Var Args,Arrays and overloading
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter