File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mock Question 02

 
Alibabra Sanjie
Ranch Hand
Posts: 147
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Q11 Suppose we have an image �image.png� with width 150 and height 50 pixel what will be outcome of the following code snippet assuming the image.png is available and other relevant classes are available
Sprite sprite = new Sprite(�image.png�, 100,50);
a) the program will fail at compile time.
b) the program will fail at runtime with IllegalArgumentException.
c) the program will run successfully with only one frame of size 100 by 50.
d) the program will run successfully with three frames of 50 by 50.

I will choose C,D

Q19 Player class implements Controllable interface

a) True
b) False

The answer is A, but I believe it's B because first Player is a interface, not a class

What do you think?
[ October 26, 2004: Message edited by: Alibabra Sanjie ]
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Alibabra Sanjie:
Q11 Suppose we have an image �image.png� with width 150 and height 50 pixel what will be outcome of the following code snippet assuming the image.png is available and other relevant classes are available
Sprite sprite = new Sprite(�image.png�, 100,50);
a) the program will fail at compile time.
b) the program will fail at runtime with IllegalArgumentException.
c) the program will run successfully with only one frame of size 100 by 50.
d) the program will run successfully with three frames of 50 by 50.

I will choose C,D

Q19 Player class implements Controllable interface

a) True
b) False

The answer is A, but I believe it's B because first Player is a interface, not a class

For Q11, I can say that there will be a runtime error with IllegalArgumentException, which is choice B. Because the image width is not an integer multiple of the frameWidth specified as parameter of Sprite Constructor... If that is Sprite sprite = new Sprite(�image.png�, 50,50);, it will be alright... So the correct choice is B.

For Q19, you are right. Player interface extends Controllable interface... The correct choice is B...

Hope it helps...
 
Aryan Khan
Ranch Hand
Posts: 290
Java Oracle Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes Ko Ko Naing is right about first question
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by AhmadS Khan:
Yes Ko Ko Naing is right about first question


I believe both Alibabra and me got correct in the second question also...
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic