• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Mock Question 02

 
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Ranch Hand
Posts: 290
Oracle Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes Ko Ko Naing is right about first question
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic