wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

.Net_Datatypes

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

Which of the following is a value type in C#?

a)

string

b)

dynamic

c)

float

d)

object

2.

What does the sizeof(int) return in C# on most platforms?

a)

2 bytes

b)

4 bytes

c)

8 bytes

d)

platform-dependent

3.

Converting a value type to object type is known as:

a)

Casting

b)

Parsing

c)

unboxing

d)

Boxing

4.

Which of the following is NOT a reference type in C#?

a)

integer

b)

class

c)

string

d)

interface

5.

Which identifier name is valid in C#?

a)

2Value

b)

first-name

c)

_count

d)

int

6.

Which of the following is NOT allowed in a C# identifier?

a)

alphabet

b)

number

c)

underscore

d)

whitespace

7.

Which data type has the largest size among the following?

a)

int

b)

long

c)

float

d)

decimal

8.

What is the main difference between object and dynamic reference types?

a)

Both are checked at compile time

b)

object is compile-time checked; dynamic is runtime checked

c)

Both are runtime checked

d)

dynamic is faster than object

9.

Which of the following correctly creates a verbatim(Ignoring Escape Sequences/Multilin) string literal in C#?

a)

"Sample Text"

b)

\"Sample Text"

c)

@"Sample Text"

d)

#”Sample Text”

10.

What is the correct syntax for declaring a pointer to an integer in C#?

a)

pointer int p;

b)

int p*;

c)

int* p;

d)

*int p;