File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Resolve.........

 
Shiaber Shaam
Ranch Hand
Posts: 252
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 40
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This will not work, i.e. compiler error, because the IS-A relation does not apply to the elements of the array.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic