wood burning stoves 2.0*
The moose likes Product and Other Certifications and the fly likes Mock Question 02 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Product and Other Certifications
Bookmark "Mock Question 02" Watch "Mock Question 02" New topic
Author

Mock Question 02

Alibabra Sanjie
Ranch Hand

Joined: Feb 09, 2004
Posts: 147
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 ]

Alibabra
Ko Ko Naing
Ranch Hand

Joined: Jun 08, 2002
Posts: 3178
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...


Co-author of SCMAD Exam Guide, Author of JMADPlus
SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0
Aryan Khan
Ranch Hand

Joined: Sep 12, 2004
Posts: 290

Yes Ko Ko Naing is right about first question


OCP/MCP/SCJP/SCWCD/IBM XML/SCMAD/SCEA-1
Ko Ko Naing
Ranch Hand

Joined: Jun 08, 2002
Posts: 3178
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
 
subject: Mock Question 02
 
Similar Threads
Why does a char value also have an integer value?
A cast problem!!
jsp /java i m not able to fine currect solutions
interface