jQuery in Action, 3rd edition
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Resolve......... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Resolve........." Watch "Resolve........." New topic


Shiaber Shaam
Ranch Hand

Joined: Jun 16, 2006
Posts: 252
public class Test
public static void main(String args[])
calculate(new int[] { 0, 1, 3 }); //1

static void calculate(long[] l) //2
System.out.println(l.length); //3
A : The code does not compile due to line //1
B : The code does not compile due to line //2
C : The code does not compile due to line //3
D : The code compiles and runs with output: 3
E : The code compiles but throws exception at line //1 at runtime

Dick Eimers
Ranch Hand

Joined: Apr 15, 2006
Posts: 40
This will not work, i.e. compiler error, because the IS-A relation does not apply to the elements of the array.

<a href="http://eimers.blogspot.com" target="_blank" rel="nofollow">eimers.blogspot.com</a>
I agree. Here's the link: http://aspose.com/file-tools
subject: Resolve.........
It's not a secret anymore!