File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes questions in Boone's exam Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "questions in Boone Watch "questions in Boone New topic
Author

questions in Boone's exam

Kathy Wang
Greenhorn

Joined: Sep 06, 2001
Posts: 28
Hi,everyone!
I just did Boone's exam,and came up with two questions, can you help me out? Thanks.
1. My question is what is the difference between c and d?
Question 70: To place a 1 in the high-bit of an int named ref that��s set to 0x00000001, you can write:
Select the one right answer.
a. ref >> 31;
b. ref >>= 31;
c. ref << 31;
d. ref <<= 31;
e. Shifts the bits in an integer to the left by the number of bits specified and fills the right-most bit with 1.
f. Shifts the bits in an integer to the left by the number of bits specified and fills the right-most bit with 0.
Answer is d.

2.Do we need to know stuff like Q18 and Q56?
Question 18: What method name can you use from the applet to read a String passed to an applet via the <param> tag? (Supply the method name only, without parameters.)
Question 56: Which of the following is a valid way to embed an applet class named Q56 into a Web page?
Select all right answers.
a) <applet class=Q56.class width=100 height=100>
</applet>
....

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Kathy,
I played around with Question 1 you had posted and have made a few interesting observations:

This code will not compile because *1* is not a statement.
But this code will work...

It will print out -2147483648 (The maximum negative limit for int)

Label1 : If you insert the statement System.out.println(ref); after *2*, it will print 1.
The code shown below will compile and print -2147483648


The point I am trying to make here is that although the operation ref<<31; does the job...it does not do it permanently( refer to label1 above.) whereas the third code does the job permanently and hence is the more appropriate choice as an answer for your question.
Had option d not been given, c would have been the correct choice.
Hope this helps. DO correct me if I am wrong.

Shyam
[This message has been edited by Shyamsundar Gururaj (edited September 08, 2001).]
Kathy Wang
Greenhorn

Joined: Sep 06, 2001
Posts: 28
Thanks a lot, Shyamsundar .
I think you are right. Based on your code:
ref<<31 means just left shift ref, the result is not assigned to ref. But in ref<<=31, ref is not only left shifted, but also result is assigned to ref.
Your explaination do help. Thanks again.
Kathy
Kathy Wang
Greenhorn

Joined: Sep 06, 2001
Posts: 28
Oops! To my second question, I just found the applet is executed. Ai, all I can say is the browser is really smart!
Here is the question again,
2.Do we need to know stuff like Q18 and Q56?
Question 18: What method name can you use from the applet to read a String passed to an applet via the tag? (Supply the method name only, without parameters.)
Answer: getParameter

Question 56: Which of the following is a valid way to embed an applet class named Q56 into a Web page?
Select all right answers.
a.
applet class=Q56.class width=100 height=100>
/applet>
.......
Thanks for your help!
Geoffrey Falk
Ranch Hand

Joined: Aug 17, 2001
Posts: 171
    
    1
To answer your question (2): There are no questions about Applets on the new Java 2 (310-025) exam. This topic was dropped since the previous Java certification exam. You can ignore any questions about Applets that you find on mock exams.
Geoffrey
------------------
Sun Certified Programmer for the Java 2 Platform
[This message has been edited by Geoffrey Falk (edited September 08, 2001).]


Sun Certified Programmer for the Java 2 Platform
Kathy Wang
Greenhorn

Joined: Sep 06, 2001
Posts: 28
Thank you very much, Geoffrey! Now I can ease on that topic.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: questions in Boone's exam
 
Similar Threads
Boone's Question on Threads
Boone's qns
Boone Exam question 70
BB Question 70--Shift Operator
Shift Operators