Topics Index


If you need explanation Read this topic

If you need Answer Take test on this topic

public class Sample {
    public static void main(String s[])

A. -126
B. 125
C. Some other output
D. Compilation Error or Runtime Error
Topic: Java Double Class And Java Float Class

If you need explanation Read this topic

If you need Answer Take test on this topic

User comments below. All of them might not be correct.

Ans is Min_Exponent is an static final variable which tells the min power an float variable can it will return the -126

Posted by Uday Kumar    2015-01-13 03:50:38

Ans is Option A.... after execution starts it will go to println statement we have given float.min_exponent that means in predefined class Float having static and final variable MIN_EXPONENT initialized with the value of -126 so it will print the value of MIN_EXPONENT as -126

Posted by Bhagi Bhagyasri    2015-01-13 04:04:08

i'll go with option A ... Float.MIN_EXPONENT  denotes accessing of a Static final Constant value "MIN_EXPONENT" from the class called "Float"  ... sysout prints that value and that value is Predefined in the API and is equal to -126..

Posted by ?????????? ?????    2015-01-13 05:02:08

Ans is A ....MIN_EXPONENT  returns the maximum negative integral exponent that the floating-point type can represent as a finite value when a base of radix is raised to that power.  so when the compiler enter into main it prints the value of float.MIN_EXPONENT as-126

Posted by Ramya Reddy Addulla    2015-01-13 05:08:57

ANS IS A (-126)

--Here Float class of java is used.

--In above example min_Exponent variable of "Float" wrapper class is used.Some predefined variable of class "Float" is used to display the value.


public static final int MIN_EXPONENT

Minimum exponent a normalized float variable may have. It is equal to the value returned by Math.getExponent(Float.MIN_NORMAL).
--Floating point variable can have exponent from "-126 to 127"

Posted by Mânïshå Mùlchåndânï    2015-01-13 11:11:39

ans a ..The single-precision binary floating-point exponent is encoded using an offset-binary representation, with the zero offset being 127; also known as exponent bias in the IEEE 754 standard.

this value is equal to the value returned by Math.getExponent

static float MIN_NORMAL -- This is a constant holding the smallest positive normal value of type float, 2^-126.

Posted by Maheshwari Natarajan    2015-01-14 07:45:47

ans is A

Posted by Shubham Bansal    2015-01-14 13:53:50

This dose is now closed and the winners are Bhagi Bhagyasri,  for 'First Correct Comment', Ramya Reddy Addulla,  for 'Best Comment' and Sai Ram for the 'Popular Comment'. The 'lucky liker' is Urvashi Arya. Please login into Merit Campus using facebook, to claim your recharge. Go to to raise the recharge.

Posted by Merit Campus    2015-01-19 05:11:00

© meritcampus 2019

All Rights Reserved.

Open In App