It's not a secret anymore!*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Mock Exam quesions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Mock Exam quesions" Watch "Mock Exam quesions" New topic
Author

Mock Exam quesions

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hi,
Can somebody please give me the answers for these?
How can you write a line of code for an applet's init() method that determines how wide the applet is?
a) int width = this.getY();
b) int width = this.getSize().w;
c) int width=getSize();
d) int width = getSize().w;
e) int width = getWidth();
2) Which statements accurately describe the following line of code?
select all valid answers.
String [][]s = new String[10][];
a) This line of code is illegal
b) s is a two dimensional array containing 10 rows and 10 columns
c) s is an array of 10 arrays
d) Each element is set to ""
e) Each element is uninitialized and must be initialized before it is referenced.
My answer for this: c,e. I don't have the actual answers
Rolf Weasel
Ranch Hand

Joined: Feb 26, 2000
Posts: 82
the 10 array references are initialized to null.


May the Moose be with you.
maha anna
Ranch Hand

Joined: Jan 31, 2000
Posts: 1467
a)int width = this.getY(); //NO getY() returns the y coordinate
b) int width = this.getSize().w; //NO getSize() returns Dimention,but it doesn't have a field as 'w' (Dimention has got 'width' as field)
c) int width=getSize(); //NO, refer to b)
d) int width = getSize().w; //NO refer to b)
e) int width = getWidth(); //YES returns the width of the comp.
regds
maha anna.
Jim,
I saw your request in Marcus forum. Is this what you wanted to know?. Instead of < symbol put & l t ;(no space in bet) and for > symbol put & g t ( no space in bet). But in the other forum it is not displayed properly.
<PRE>
<pre>
All your info typed , displayed as it is...
All your info typed , displayed as it is...
All your info typed , displayed as it is...
</pre>
</PRE>

[This message has been edited by maha anna (edited March 07, 2000).]
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
Thanks, m.a. The thing is, I know how to do that here, I just can't figure out how to do it in Marcus's forum. The software works differently there, and the & lt ; and & gt ; don't work. Also, here you can also just type "< pre >", and the spaces are enough to convince the browser that it's not an actual HTML tag, rather it's something to display. But there, everything between the "<" and ">" gets eaten.


"I'm not back." - Bill Harding, Twister
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Mock Exam quesions
 
Similar Threads
Barry Boone Questions.
I did see this question in the other dis.. group.I think all the answers are false.
Correct me!!!
Barry Boones Mock Exam newtest.html
Stuck on Homework