Answer the following questions based on Program 4: //Program 4 3 Integer il = (i) String strval = "77"; Character cl = '
Posted: Fri May 20, 2022 11:49 am
questions based on Program 4: //Program 4 3 Integer il = (i) String strval = "77"; Character cl = 'm'; int i2 = (ii) char c2 = cl; 7 HNMOOOHHHHH )); 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 cl: " + cl); 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 Figure 2 (i) Integer valueof (44)
(i) Integer valueof (44) (ii) Integer.intValue(ii) (iii) Int.valueof(strval) (ii) i1. intValue) () Integer.parseInt(44) (i) Int.valueOf(44) (ii) Int.parseInt(44) (iii) Integer.parseInteger(strval) (ii) Int.valueof(11) Int.parseInt(strval) il.integerValue (44) (ii) Int.intValue(11) (i) Integer.intValue(44) (0) Int. intValue (44) (iii) Integer.parseInt(strval) (iii) strval.intValue() (i) Integer.parseInteger (44) (ii) Integer.parseInt(i1) (iii) Integer intValue(strval) O (i) Int.parseInt(44)
b) Assuming Program 4 has been completed, identify the two statements in Program 4 that perform unboxing. O Line 4 Line 8 O Line 5 O Line 6 O Line 7
Answer the following (i) Integer valueof (44) (ii) Integer.intValue(ii) (iii) Int.valueof(strval) (ii) i1. intValue) () Integer.parseInt(44) (i) Int.valueOf(44) (ii) Int.parseInt(44) (iii) Integer.parseInteger(strval) (ii) Int.valueof(11) Int.parseInt(strval) il.integerValue (44) (ii) Int.intValue(11) (i) Integer.intValue(44) (0) Int. intValue (44) (iii) Integer.parseInt(strval) (iii) strval.intValue() (i) Integer.parseInteger (44) (ii) Integer.parseInt(i1) (iii) Integer intValue(strval) O (i) Int.parseInt(44)
b) Assuming Program 4 has been completed, identify the two statements in Program 4 that perform unboxing. O Line 4 Line 8 O Line 5 O Line 6 O Line 7