1. What will be the output of the program? try { Float f1 = new Float("3.0"); int x = f1.intValue(); byte b = f1.byteValue(); double d = f1.doubleValue(); System.out.println(x + b + d); } catch (NumberFormatException e) / Line 9 / { System.out.println("bad number"); / Line 11 / }





Ask Your Doubts Here

Type in
(Press Ctrl+g to toggle between English and the chosen language)

Comments

  • By: guest on 02 Jun 2017 01.26 am
    The xxxValue() methods convert any numeric wrapper object's value to any primitive type. When narrowing is necessary, significant bits are dropped and the results are difficult to calculate.
Show Similar Question And Answers
QA->172. To catch red-handed....
QA->Name the translatory program which translates the high level language into machine language before running the program?....
QA->An unauthorized program which functions from inside what seems to be an authorized program, thereby concealing what it is actually doing:....
QA->An unauthorized program which functions from inside what seems to be an authorized program, thereby concealing what it is actually doing:....
QA->An unauthorized program which functions from inside what seems to be an authorized program, thereby concealing what it is actually doing:....
MCQ->What will be the output of the program? try { Float f1 = new Float("3.0"); int x = f1.intValue(); byte b = f1.byteValue(); double d = f1.doubleValue(); System.out.println(x + b + d); } catch (NumberFormatException e) / Line 9 / { System.out.println("bad number"); / Line 11 / }....
MCQ->What will be the output of the program? public class NFE { public static void main(String [] args) { String s = "42"; try { s = s.concat(".5"); / Line 8 / double d = Double.parseDouble(s); s = Double.toString(d); int x = (int) Math.ceil(Double.valueOf(s).doubleValue()); System.out.println(x); } catch (NumberFormatException e) { System.out.println("bad number"); } } }....
MCQ->What will be the output of the program? #include<stdio.h> #include<stdarg.h> void fun1(char, int, int , float , char ); void fun2(char ch, ...); void (p1)(char, int, int , float , char ); void (p2)(char ch, ...); int main() { char ch='A'; int i=10; float f=3.14; char p="Hello"; p1=fun1; p2=fun2; (p1)(ch, i, &i, &f, p); (p2)(ch, i, &i, &f, p); return 0; } void fun1(char ch, int i, int pi, float pf, char p) { printf("%c %d %d %f %s \n", ch, i, pi, pf, p); } void fun2(char ch, ...) { int i, pi; float pf; char p; va_list list; printf("%c ", ch); va_start(list, ch); i = va_arg(list, int); printf("%d ", i); pi = va_arg(list, int); printf("%d ", pi); pf = va_arg(list, float); printf("%f ", pf); p = va_arg(list, char ); printf("%s", p); }....
MCQ->What will be the output of the following program? #include<iostream.h> double BixFunction(double, double, double = 0, double = 0, double = 0); int main() { double d = 2.3; cout<< BixFunction(d, 7) << " "; cout<< BixFunction(d, 7, 6) << endl; return 0; } double BixFunction(double x, double p, double q, double r, double s) { return p +(q +(r + s x) x) x; }....
MCQ->interface DoMath { double getArea(int rad); } interface MathPlus { double getVol(int b, int h); } / Missing Statements ? / which two code fragments inserted at end of the program, will allow to compile? class AllMath extends DoMath { double getArea(int r); } interface AllMath implements MathPlus { double getVol(int x, int y); } interface AllMath extends DoMath { float getAvg(int h, int l); } class AllMath implements MathPlus { double getArea(int rad); } abstract class AllMath implements DoMath, MathPlus { public double getArea(int rad) { return rad rad 3.14; } }....
Terms And Service:We do not guarantee the accuracy of available data ..We Provide Information On Public Data.. Please consult an expert before using this data for commercial or personal use | Powered By:Omega Web Solutions
© 2002-2017 Omega Education PVT LTD...Privacy | Terms And Conditions
Question ANSWER With Solution