Menu

[Solved]-1 Given Following Code Fragment String Num 123 Character C P Int Num1 Integerparseint Num Q37224721

1. Given the following code fragment:

String num = “123”;

Character c = ‘p’;

int num1 = Integer.parseInt(num);

String str = c.toString();

one of the following statements holds…

  1. the initialization of variable str triggers a syntaxerror.
  2. the initialization of variable num1 triggers a syntaxerror.
  3. toString is a static method of class Character that copies astring value into a new string.
  4. parseInt is a static method of class Integer that parses anumeric string into an integer value

2. The “correctness” core quality of software refers tothe fact that …

  1. programs efficiently support the insertion of new features,improvements, corrections
  2. programs answer to requested user actions within acceptabletime delays.
  3. programs compile without any syntax errors.
  4. programs accurately meet the specifications of behaviour andrequired outputs

3. If the 4-bit two’s complement representations ofintegers J and K are 0100 and 1001, respectively, then the decimalrepresentation of integer (J – K) (K subtracted from J)is…

Expert Answer


Answer to 1. Given the following code fragment: String num = “123”; Character c = ‘p’; int num1 = Integer.parseInt(num); String st… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *