Page 71 - CITS - CSA - TP (Volume 2) - Hindi
P. 71

कं  ूटर सॉ वेयर ए ीके शन - CITS



                   // longValue()
                   long longResult = intValue.longValue();
                   System.out.println(“longValue(): “ + longResult);


                   // floatValue()
                   float floatResult = intValue.floatValue();
                   System.out.println(“floatValue(): “ + floatResult);


                   // doubleValue()
                   double doubleResult = intValue.doubleValue();
                   System.out.println(“doubleValue(): “ + doubleResult);
               }
           }

           आउटपुट :












           4  लॉ ग
              •   64-िबट साइंड इंटीजर का  ितिनिध  करता है।

              •   िविधयों म  शािमल ह : longValue(), floatValue(), doubleValue()।
              Task_Long: यहाँ एक उदाहरण  ो ाम िदया गया है जो Long  ास के  िलए Number  ास से  ा  िविधयों के  उपयोग को  दिश त करता
              है:
              public class LongMethodsExample {
               public static void main(String[] args) {
                   // Example using Long class

                   Long longValue = 123456L;


                   // longValue()
                   long longResult = longValue.longValue();
                   System.out.println(“longValue(): “ + longResult);



                   // floatValue()
                   float floatResult = longValue.floatValue();
                   System.out.println(“floatValue(): “ + floatResult);


                   // doubleValue()

                   double doubleResult = longValue.doubleValue();
                   System.out.println(“doubleValue(): “ + doubleResult);
               }

                                                           57

                                   CITS : IT & ITES - कं  ूटर सॉ वेयर ए ीके शन - अ ास 90
   66   67   68   69   70   71   72   73   74   75   76