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

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




                   // intValue()
                   int intResult = byteValue.intValue();

                   System.out.println(“intValue(): “ + intResult);


                   // longValue()

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



                   // floatValue()
                   float floatWResult = byteValue.floatValue();

                   System.out.println(“floatValue(): “ + floatResult);


                   // doubleValue()

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

           }
           आउटपुट :

















           2  शॉट
              •  16-िबट साइंड इंटीजर का  ितिनिध  करता है।
              •   िविधयों म  शािमल ह : shortValue(), intValue(), longValue(), floatValue(), doubleValue().

               Task_Short : यहाँ एक उदाहरण  ो ाम िदया गया है जो शॉट   ास के  िलए Number  ास से  ा  िविधयों के  उपयोग को  दिश त करता
              है:
            public class ShortMethodsExample {
               public static void main(String[] args) {

                   // Example using Short class
                   Short shortValue = 300;
                   // byteValue()

                   byte byteResult = shortValue.byteValue();
                   System.out.println(“byteValue(): “ + byteResult);



                                                           55

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