Page 72 - CITS - CSA - TP (Volume 2) - Hindi
P. 72
कं ूटर सॉ वेयर ए ीके शन - CITS
}
आउटपुट:
5 ोट
• Represents a 32-bit IEEE 754 floating-point.
• Methods include: floatValue(), doubleValue().
Task_Float: Here’s an example program demonstrating the use of methods inherited from the Number class for the Float
class:
public class FloatMethodsExample {
public static void main(String[] args) {
// Example using Float class
Float floatValue = 3.14f;
// floatValue()
float floatResult = floatValue.floatValue();
System.out.println(“floatValue(): “ + floatResult);
// doubleValue()
double doubleResult = floatValue.doubleValue();
System.out.println(“doubleValue(): “ + doubleResult);
}
}
आउटपुट:
58
CITS : IT & ITES - कं ूटर सॉ वेयर ए ीके शन - अ ास 90

