Two Laptop Bag
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

Win a copy of Elasticsearch in Action this week in the Big Data forum!
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="" target="_blank" rel="nofollow"></a>
I agree. Here's the link:
subject: Resolve.........