answersLogoWhite

0


Best Answer

The wrapper class for float is Float.

java.lang.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Which is the wrapper class for the data type float?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is type wrappers in java?

A wrapper class in the Java programming language is one of eight classes provided in the java.lang package to create objects for the eight primitive types. All of the primitive wrapper classes in Java are immutable. Wrapper classes are used to represent primitive values when an Object is required. The wrapper classes are used extensively with Collection classes in the java.util package and with the classes in the java.lang.reflect reflection package. The Wrapper classes are: 1. Byte 2. Short 3. Integer 4. Long 5. Float 6. Double 7. Character 8. Boolean The Byte, Short, Integer, Long, Float and Double are all subclasses of the Number class. If you notice, the names of these wrapper classes are just the same as their primitive data type with a capitalized first letter. These wrapper classes start with a upper case alphabet while their primitive counterparts start with a lowercase alphabet.


Java program to illustrate Wrapper class?

java uses simple or primitive data types, such as int, char and Boolean etc. These data types are not part of the object hierarchy. They are passed by value to methods and cannot be directly passed by reference. However, at times there is a need to create an object representation of these simple data types. To address this need, Java provides classes that correspond to each of these simple types. These classes encapsulate, or wrap, the simple data type within a class. Thus, they are commonly referred to as wrapper classes. Wrapper classes corresponding to respective simple data types are as given in table below. Primitive Data Types Wrapper class byte Byte short Short int Integer long Long char Character float Float double Double boolean Boolean void Void eg Say supposing there is a requirement to store only the object in an array A.The Primitive types cannot be stored in the same array as the array can accommodate only Objects here is where Wrapper Class come into picture.ie, we create wrapper for the primitive types.One such example is as below Ex:int i; Wrapper class for the primitive type(int) is created as below: Integer i = new Integer();


What is wrapper class and its use?

When we need to store primitive datatypes(The data types we use in genera like:int,long,float etc)as objects, we use wrapper classes.Means in utility classes all the utility classes stores Objects.So when we need to store a primitive datatype,We make an object of that primitive data and store it. Say supposing there is a requirement to store only the object in an array A.The Primitive types cannot be stored in the same array as the array can accommodate only Objects here is where Wrapper Class come into picture.ie, we create wrapper for the primitive types.One such example is as below Ex:int i; Wrapper class for the primitive type(int) is created as below: Integer i = new Integer(); That's why we use Wrapper classes in Java


What are Class Constructor and Primitive data types?

class constructor is a function which has the same name as the class name and has no return type. primitive data types are the fundamental data types which are independent. eg:int,char,float etc..............


What are object wrappers?

Wrapper classes are classes that are used to make primitive variables into objects, and to make wrapped objects into primitives. int, boolean, double are all primitive data types and their respective wrapper classes are Integer, Boolean, and Double. Wrapper classes are useful in storing primitive data types in higher level data structures such as Stack<Object>, List<Object>, Queue<Object>, since primitives cannot be directly placed in these data structures they must be boxed in the wrapper classes. But, here's the good news, with the new Java 5.0, there is no need no worry about wrapper classes and boxing and unboxing (unless it's something taught in class), since there is auto-boxing and unboxing, therefore, one can directly "add" primitives to a data structure and let the JVM do the rest.

Related questions

What is wrapper class in java?

wrapper class is a predefined class .it is used for converting primitive data types into object type


What is type wrappers in java?

A wrapper class in the Java programming language is one of eight classes provided in the java.lang package to create objects for the eight primitive types. All of the primitive wrapper classes in Java are immutable. Wrapper classes are used to represent primitive values when an Object is required. The wrapper classes are used extensively with Collection classes in the java.util package and with the classes in the java.lang.reflect reflection package. The Wrapper classes are: 1. Byte 2. Short 3. Integer 4. Long 5. Float 6. Double 7. Character 8. Boolean The Byte, Short, Integer, Long, Float and Double are all subclasses of the Number class. If you notice, the names of these wrapper classes are just the same as their primitive data type with a capitalized first letter. These wrapper classes start with a upper case alphabet while their primitive counterparts start with a lowercase alphabet.


Java program to illustrate Wrapper class?

java uses simple or primitive data types, such as int, char and Boolean etc. These data types are not part of the object hierarchy. They are passed by value to methods and cannot be directly passed by reference. However, at times there is a need to create an object representation of these simple data types. To address this need, Java provides classes that correspond to each of these simple types. These classes encapsulate, or wrap, the simple data type within a class. Thus, they are commonly referred to as wrapper classes. Wrapper classes corresponding to respective simple data types are as given in table below. Primitive Data Types Wrapper class byte Byte short Short int Integer long Long char Character float Float double Double boolean Boolean void Void eg Say supposing there is a requirement to store only the object in an array A.The Primitive types cannot be stored in the same array as the array can accommodate only Objects here is where Wrapper Class come into picture.ie, we create wrapper for the primitive types.One such example is as below Ex:int i; Wrapper class for the primitive type(int) is created as below: Integer i = new Integer();


What is wrapper class and its use?

When we need to store primitive datatypes(The data types we use in genera like:int,long,float etc)as objects, we use wrapper classes.Means in utility classes all the utility classes stores Objects.So when we need to store a primitive datatype,We make an object of that primitive data and store it. Say supposing there is a requirement to store only the object in an array A.The Primitive types cannot be stored in the same array as the array can accommodate only Objects here is where Wrapper Class come into picture.ie, we create wrapper for the primitive types.One such example is as below Ex:int i; Wrapper class for the primitive type(int) is created as below: Integer i = new Integer(); That's why we use Wrapper classes in Java


Why should double data type is preferable over float data type?

by default any float value is double


What are Class Constructor and Primitive data types?

class constructor is a function which has the same name as the class name and has no return type. primitive data types are the fundamental data types which are independent. eg:int,char,float etc..............


In access what is the The data type of an item price?

float data


What TYPES of return values are allowed?

Apart from basic Data types (int , char , float and double ) you can even return Class Objects.Nearly any type of Data can be returned by a function including pointers to void data type.


Is float is a keyword in java?

yes, float is keyword and data type in java


What are object wrappers?

Wrapper classes are classes that are used to make primitive variables into objects, and to make wrapped objects into primitives. int, boolean, double are all primitive data types and their respective wrapper classes are Integer, Boolean, and Double. Wrapper classes are useful in storing primitive data types in higher level data structures such as Stack<Object>, List<Object>, Queue<Object>, since primitives cannot be directly placed in these data structures they must be boxed in the wrapper classes. But, here's the good news, with the new Java 5.0, there is no need no worry about wrapper classes and boxing and unboxing (unless it's something taught in class), since there is auto-boxing and unboxing, therefore, one can directly "add" primitives to a data structure and let the JVM do the rest.


Why can't have only float data type instead int and float?

Because that is how the language is defined. It has floating data types and integral data types.


What is the benefit of float data type?

Floating type numbers can't be stored in integer type variables. If we do that then their fractional part will be lost. So, we use float data type to store numbers with fractional parts.