Search Header Logo

C#8, C#9 (06)

Authored by Nataly Revutska

Computers

1st - 5th Grade

Used 1+ times

C#8, C#9 (06)
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

6 questions

Show all answers

1.

FILL IN THE BLANK QUESTION

45 sec • 1 pt

In C# 9 and ___, the init keyword defines an accessor method in a property or indexer. An ___-only setter assigns a value to the property or the indexer element only during object construction.

2.

FILL IN THE BLANK QUESTION

2 mins • 1 pt

Write a single-line "Hello World" program.

3.

FILL IN THE BLANK QUESTION

1 min • 1 pt

Does it work?

...

int x = 0;

(x, int y) = point;

...

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the output of program:

var digits = new string[]

{ "one", "two", "three", "four", "five" };

var range = digits[^2..];

foreach (var digit in range)

Console.Write($"{digit} ");

one two three

four five

four

IndexOutOfRangeException trown

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Is code inside if operator executed?

int a = 10;

if (a is >= 20 and <30 or >=5 and <11)

{// Some code}

Yes

No

The code doesn't compile

6.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

We have constructed class:

public struct Coords<T>

{

public T X;

public T Y;

}

Are types Coords<int>, Coords<object> unmanaged?(since C# 8.0)

Yes. Both are unmanaged.

No. Neither are unmanaged.

Coords<int> are unmanaged, Coords<object> are not unmanaged

Coords<int> are not unmanaged, Coords<object> are unmanaged

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?