answersLogoWhite

0

It is possible in JDK 1.5 and above. In JDK 1.4, you also cast the Float value into float value by using casting.

For exampe in JDK 1.5, its possible

float f = 12;

Float ff = f;

but in JDK 1.4, you will use casting i.e

float f = 12;

Float ff = (float)f;

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

How do you change a float into a double using java?

with help of type casting it is possible


Is float is a keyword in java?

yes, float is keyword and data type in java


How do you declare an array of 8 floats?

In C float a[8]; In Java float a[] = new float[8];


How can I convert a float to a double in Java?

To convert a float to a double in Java, you can simply assign the float value to a double variable. Java will automatically perform the conversion for you. Here's an example: java float floatValue 10.5f; double doubleValue floatValue; In this example, the float value 10.5f is assigned to the double variable doubleValue, which will now hold the converted double value.


Does java moss float?

Only if it's not charred.


What are two Java primitive types store floating-point numbers?

In Java, you can use either a float or a double


Is float a data type in Java?

Yes it is but it is not usually used


What are java kaywords?

if ,while,do , int ,float, for,switch,else,


How to declare a float variable in java?

it is the same as an int, String, or any of the others:float myVar = 5.7f;If you try to assign a decimal number you must place an "f" at the end, otherwise Java will assume you are trying to assign a double.


Can a double value be assigned to float variable?

THIS IS FOR JAVA i don't know about anything about other languages yes it can be assignedthe syntax is:int (number) = (float) numberFOR EXAMPLE:int = a;a = (float ) 5.5;if the (float) is not there then in Java it gives an error saying precision loss of data type


Why java is not a pure object oriented?

java is not purely oops because of primitive types in java like int and float double


Is this legal float f equals 2?

At least in Java, that's legal - 2 is treated as an int, which can be converted without problems to the float type.