1.Which of the following methods is the best way to store an integer value typed by the...

Question:

1.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
2.The statement object obj = 72 is an example of which of the following?
a.Explicit conversion
b.Immutable conversion
c.Boxing
d.Unboxing
3.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());
4.Which of the following is not a String method?
a.IndexOf
b.StartsWith
c.StopsWith
d.Trim
5.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.
6.Which of the following statements can you use to catch integer overflow and underflow errors?
a.checked
b.overflow
c.watch
d.try
7.Which of the following techniques should you use to watch for floating point operations that cause overflow or underflow?
a.Use a checked block.
b.Use a try-catch block.
c.Check the result for the value Infinity or NegativeInfinity.
d.Check the result for Error.
Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: