Menu
Topics Index
...
`

Type3001


If you need explanation Read this topic

If you need Answer Take test on this topic

Type3001
What will be the output of the following program?
public class Sample {
    public static void main(String s[])
    {
        System.out.println(Float.TYPE);
        
    }
}

A. float
B. Some other output
C. Compilation Error
D. 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.

A. Float

Posted by Sprutika Battu    2015-02-03 14:38:00


ANS IS A (float)

--Here the concept of Wrapper class is used.

--Here,value of Static variable "TYPE" is displayed which
is present in Flota wrapper class.

static Float TYPE:

The Class instance representing the primitive type float.

--so,float will get printed.

Posted by Mânïshå Mùlchåndânï    2015-02-03 14:38:38


i'll go with option A because sysout prints the Value of "TYPE" field in "Float" Class which is float..

Posted by ?????????? ?????    2015-02-03 14:41:02


ans a. in this program ly contains single sop statement, which prints constant value defined in the Float wrapper class.  Float is a Primitive Wrapper Class. It is used to wrap the float value into Float object. Type defines class object for float.so sop print Float.TYPE= float

Posted by Maheshwari Natarajan    2015-02-03 18:27:28


This dose is now closed and the winners are Mânïshå Mùlchåndânï,  for 'First Correct Comment', ?????????? ?????, Maheshwari Natarajan,  for 'Best Comment' and Mânïshå Mùlchåndânï for the 'Popular Comment'. The 'lucky liker' is Gopinath Manchikanti. Please login into Merit Campus using facebook, to claim your recharge. Go to http://java.meritcampus.com/earnings to raise the recharge.

Posted by Merit Campus    2015-02-04 04:45:50


© meritcampus 2019

All Rights Reserved.

Open In App