Aidos Baktaev
Quiz by , created more than 1 year ago

Quiz on .NET, created by Aidos Baktaev on 15/05/2018.

76
0
0
No tags specified
Aidos Baktaev
Created by Aidos Baktaev about 6 years ago
Close

.NET

Question 1 of 10

1

Which of the following are value types? (Choose 3)

Select one or more of the following:

  • Decimal

  • String

  • System.Drawing.Point

  • Integer

Explanation

Question 2 of 10

1

Which is the correct declaration for a nullable integer?

Select one of the following:

  • Nullable(int) i = null;

  • Nullable<int> i = null;

  • int i = null;

  • int<Nullable> i = null;

Explanation

Question 3 of 10

1

Which of the following are reference types? (Choose 2)

Select one or more of the following:

  • Types declared Nullable

  • String

  • Exception

  • All types derived from System.Object

Explanation

Question 4 of 10

1

What is the correct order for catch clauses when handling different exception types?

Select one of the following:

  • Most general to most specific

  • Most likely to occur to least likely to occur

  • Most specific to most general

  • Least likely to occur to most likely to occur

Explanation

Question 5 of 10

1

The following scenarios, which would be a good reason to use the String- Builder class instead of the String class?

Select one of the following:

  • When building a string from shorter strings

  • When working with text data longer than 256 bytes

  • When you want to search and replace the contents of a string

  • When a string is a value type

Explanation

Question 6 of 10

1

Why should you close and dispose of resources in a finally block instead of a catch block?

Select one of the following:

  • It keeps you from having to repeat the operation in each catch.

  • A finally block runs whether or not an exception occurs.

  • The compiler throws an error if resources are not disposed of in the finally block.

  • You cannot dispose of resources in a catch block.

Explanation

Question 7 of 10

1

You create an application with built-in exception handling. For some types of exceptions, you want to add an event to the Event Log that specifies the line of code that initiated the exception. Which Exception property should you use?

Select one of the following:

  • Message

  • StackTrace

  • Source

  • Data

Explanation

Question 8 of 10

1

You pass a value-type variable into a procedure as an argument. The procedure changes the variable; however, when the procedure returns, the variable has not changed. What happened?

Select one of the following:

  • The variable was not initialized before it was passed in.

  • Passing a value type into a procedure creates a copy of the data.

  • The variable was redeclared within the procedure level.

  • The procedure handled the variable as a reference.

Explanation

Question 9 of 10

1

Which of the following statements are true? (Choose 2)

Select one or more of the following:

  • Inheritance defines a contract between types.

  • Interfaces define a contract between types.

  • Inheritance derives a type from a base type.

  • Interfaces derive a type from a base type.

Explanation

Question 10 of 10

1

Which of the following are examples of built-in generic types? (Choose 2)

Select one or more of the following:

  • Nullable

  • Boolean

  • EventHandler

  • System.Drawing.Point

Explanation