A Question from javacaps mock exam 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. //true 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. Given ans : A, B, C Regardng option A] I checked the API docs but nowhere does it mention that weightx and weighty value should be between 0.0 and 1.0 So I think A should be false Comments please Amit
Amit, Yes you are right, weightx and weighty should not be any non-negative double value. it does not impose that they should be between 0.0 and 1.0 If u take it in the right sense, these can be coded and i bet you wont forget it for life when you see for yourself your results. I expect the questions in this forum of to be of WHY type rather than what is the output type. Everybody has a jdk compiler and a notepad -); I have just given a suggesstion and all out there please dont grudge me !!!