Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

C# Quiz 3

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

The only difference between a normal 'exit' and a call to FailFast is:

a)

FailFast writes to the System log, exit does not

b)

Exit writes to the System log, FailFast does not

c)

There are no fundamental differences between the two

d)

I've never heard of 'FailFast'

2.

While C++ provides a way to catch every exception, C# does not have that capability

a)

True

b)

False

3.

What does 'rethrow' do regarding Exceptions?

a)

'rethrow' is not a C# key word

b)

It causes C# to rethrow the current Exception

c)

'rethrow' functions identically in C# as it does in C++

4.

What is the purpose of a General Catch Block?

a)

It catches Exceptions that otherwise would not be caught

b)

It catches multiple uncaught Exceptions

c)

It catches all System Exceptions

5.

What is the purpose of generic in C#?

a)

Allows multiple overloads of methods

b)

Provides a shortcut for multiple implementations

c)

Provides a way to integrate interfaces and classes in inheritance structures

6.

Generics make use of parameterized types

a)

True

b)

False

c)

Types don't have parameters

7.

Generics promote type safety

a)

True

b)

False

c)

Generics have nothing to do with type safety

8.

Generics improve performance/efficiency

a)

With regard to compile-time type checking

b)

With regard to boxing and unboxing

c)

With regard to code bloat

d)

With regard to reducing unnecessary casting

e)

With regard to memory consumption

9.

Generics can be used with all three: classes, structs, interfaces

a)

True

b)

False

c)

Only with classes and structs, but not interfaces

10.

Generic methods can only be defined within generic classes

a)

True

b)

False