Which is true about range of weightx variable A. the same as integer values B. the same as double values C. from 0.0 to Double.MAX_VALUE D. from 0.0 to 1.0
Hi The answer is D.From the API: Specifies how to distribute extra horizontal space. The grid bag layout manager calculates the weight of a column to be the maximum weighty of all the components in a row. If the resulting layout is smaller horizontally than the area it needs to fill, the extra space is distributed to each column in proportion to its weight. A column that has a weight zero receives no extra space. If all the weights are zero, all the extra space appears between the grids of the cell and the left and right edges. The default value of this field is 0. weightx should be a non-negative value. Surya
The value of Double.Max_value is 1.7976931348623157E308..its not same as 1.0,try this out this will return false public static void main(String[] args) { System.out.println(Double.MAX_VALUE); System.out.println(1==Double.MAX_VALUE); }