permaculture playing cards
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 OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Mock Exam quesions" Watch "Mock Exam quesions" New topic

Mock Exam quesions

Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
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.
maha anna.
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.
All your info typed , displayed as it is...
All your info typed , displayed as it is...
All your info typed , displayed as it is...

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

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:
subject: Mock Exam quesions
jQuery in Action, 3rd edition