This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Resolve........." Watch "Resolve........." New topic
Author

Resolve.........

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


$Hi/\bEr
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.........
 
Similar Threads
scope
q from jiris.com
static final int allowed in non-static inner class
question from Sun guoqiao mock exam2
nested class