• 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 Exam quesions

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the 10 array references are initialized to null.
 
Ranch Hand
Posts: 1467
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).]
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic