Float Datatype Example Java Program
Definition
Float is a keyword which designates the 32 bit float primitive type. The java.lang.Float class is the nominal wrapper class when you need to store a float value but an object reference is required.Syntax
float= ;
Float Datatype Example Program
class FloatDatatype{ public static void main(String[] args){ float a=22.8f; float b=100.0f; System.out.println(""+a); System.out.println(""+b); } }
Sample Output
Output is: 22.8f 100.0f
Data Type Programs
Read More Articles
- Multiple Inheritance Using Interface Example Java Program
- Single Inheritance Example Java Program
- Multilevel Inheritance Example Java Program
- Hierarchical Inheritance Example Java Program
- Find all Substrings of a given string Example Java Program
- Create Matrix Example Java Program
- Sum Of Three Numbers Example Java Program
- Twin Prime Example Java Program
- Heap Sort Example Java Program
- Compile Time Polymorphism Example Java Program