Answer the following questions based on Program 4: 1 7/Program 4 2 ; Integer il = (i) String strval = "77"; Character cl

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Answer the following questions based on Program 4: 1 7/Program 4 2 ; Integer il = (i) String strval = "77"; Character cl

Post by answerhappygod »

Answer The Following Questions Based On Program 4 1 7 Program 4 2 Integer Il I String Strval 77 Character Cl 1
Answer The Following Questions Based On Program 4 1 7 Program 4 2 Integer Il I String Strval 77 Character Cl 1 (71.28 KiB) Viewed 34 times
Answer the following questions based on Program 4: 1 7/Program 4 2 ; Integer il = (i) String strval = "77"; Character cl = 'm'; int i 2 = (ii) char c2 = cl; 11 )); 8 9 10 11 12 13 14 15 System.out.println("Value of i1: + il); System.out.println("Value of i2: " + (i2 + (iii) System.out.println("Value of c1: " + c1); System.out.println("Value of c2: " + (char) (c2 + 5)); } } a) Complete Program 4 by filling in the blanks with an appropriate statement based on the output shown in Figure 2. Value of i1: 44 Value of i2: 121 Value of c1: m Value of c2: r

0 (i) i1.integerValue (44) 0 (ii) Int. intValue(il) b) Assuming Program 4 has been completed, identify the two statements in Program 4 that perform unboxing. Line 6 O Line 4 Line 7 O Line 8 Line 5

Value of c1: m Value of c2: r Figure 2 Int.intValue (44) оооооо 0 (iii) strval.intValue() O (ii) Integer.parseInt(il) 0 (0) Int.parseInt(44) Int.valueOf(44) O i il. intValue Integer.valueOf (44) o (i) Integer.intValue(44) 0 ) Integer.parseInteger(strval) 0 (ii) Int.valueOf(il) 0 (i) Integer.parseInt(44) o (i) Integer.parseInteger (44) (ii) Int.parseInt(44) O iii) Int.parseInt(strval) Integer.intValue (il) O ii) Integer.intValue(strval) (iii) Integer.parseInt(strval) o iii) Int.valueof(strval) 0 (i) i1.integerValue (44)
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply