• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

question44 from java cap

 
Ranch Hand
Posts: 144
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
44. Which statements are true about GridBagLayout ?
A) Weight x and weight y should be 0.0 and 1.0
B) If fill is both, anchor does not make sense.
C) It divides its territory in to an array of cells.
D) While constructing GridBagLayout , you won't tell how many rows and columns the
underlying grid has.
the answer is abc. i'm pretty sure a is wrong and my question is NOT regarding that...
my question is why not d? where do we declare the # of rows and columns?
 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
You are infact right.The option d IS correct.That's what the Javacap exam also says though it has a mistyped 'C' in place for 'D'.
The wrong choice is
"It divides its territory into an array of cells."
This statement cannot be right for GridBagLayout since it can span multiple rows & coloumns.
By the way why do you say choice 'A' is false???
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I think the A is false.
when I learn java by using "Core Java", I remeber the value is from 0 to 100.(some other books are 0 to 10)
In RHE page 318 " weight can be any numbers"(line 7 from bottom)
 
Priya Kannan
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the info, kevin.
 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How cone choice 2 is correct?. Is there any funda? behind it
 
Kevin Hou
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the answer B is correct.
for example: you place a button in cell, when the button is smaller than the cell, you can use anchor field to place the button in nine positions.
on the other hand, if you use the fill BOTH, the button is as big as the cell. so the anchor doesn't make sense any more.
 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
The correct answers are
B, D
Thank you all correcting this topic, and the corrected link is:
http://www.javacaps.com/scjp_mockexams.html#answer44
Konda.
 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
why is the answer 3 is incorrect?
can anyone tell me?
gridbag layout divides it's territory into arrays of cells right.
if i'm wrong tell me the correct answer with a brief explanation.
rajini
 
Anshuman Acharya
Ranch Hand
Posts: 144
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
well i never said c was wrong. my answers were bcd
reply
    Bookmark Topic Watch Topic
  • New Topic