![]() |
VOOZH | about |
setFloat() method of java.lang.reflect.Field used to set the value of a field as a float on the specified object. When you need to set the value of a field of an object as a float then you can use this method to set value over an Object. Syntax:
public void setFloat(Object obj, float f) throws IllegalArgumentException, IllegalAccessException
Parameters: This method accepts two parameters:
Return: This method returns nothing. Exception: This method throws the following Exception:
Below programs illustrate setFloat() method: Program 1:
Value of salary before applying setFloat is 143125.0 Value of salary after applying setFloat is 259939.98 Value of pf before applying setFloat is 122342.89 Value of pf after applying setFloat is 234234.34
Program 2:
Value after applying setFloat is 3244.466