Home
You may like this!
31.
Which of the following methods is the best way to store an integer value typed by the user in a variable?
  • A.
    ToString
  • B.
    Convert
  • C.
    ParseInt
  • D.
    TryParse
  • Answer & Explanation
  • Report
Answer : [D]
Explanation :
Report
Name Email  
32.
The statement object obj = 72 is an example of which of the following?
  • A.
    Explicit conversion
  • B.
    Immutable conversion
  • C.
    Boxing
  • D.
    Unboxing
  • Answer & Explanation
  • Report
Answer : [C]
Explanation :
Report
Name Email  
33.
If Employee inherits from Person and Manager inherits from Employee, which of the following statements is valid?
  • A.
    Person alice = new Employee();
  • B.
    Employee bob = new Person();
  • C.
    Manager cindy = new Employee();
  • D.
    Manager dan = (Manager)(new Employee());
  • Answer & Explanation
  • Report
Answer : [A]
Explanation :
Report
Name Email  
34.
Which of the following is not a String method?
  • A.
    IndexOf
  • B.
    StartsWith
  • C.
    StopsWith
  • D.
    Trim
  • Answer & Explanation
  • Report
Answer : [C]
Explanation :
Report
Name Email  
35.
Which of the following techniques does not create a String containing 10 spaces?
  • A.
    Set a String variable equal to a literal containing 10 spaces.
  • B.
    Use a String constructor passing it an array of 10 space characters.
  • C.
    Use a String constructor passing it the space character and 10 as the number of times it should be repeated.
  • D.
    Use the String class’s Space method passing it 10 as the number of spaces the string should contain.
  • Answer & Explanation
  • Report
Answer : [D]
Explanation :
Report
Name Email