Dotnet with C# Test Quiz

The statement that is used to replace multiple if statements is called:


Which of the following is NOT a C# (sharp) keyword?


The following code will generate a compiler error.

string GetAgePhrase(int age)

{

if (age > 60) return "Senior";

if (age > 40) return "Middle-aged";

if (age > 20) return "Adult";

if (age > 12) return "Teen-aged";

if (age > 4) return "Toddler";

}

Which of the following statements, inserted as the last line of the

function, would solve the problem?


static void Main(string[] args)

{

try

{

Console.WriteLine("Level 1");

try

{

Console.WriteLine("Level 2");

}

finally

{

Console.WriteLine("Level 2 Finished");

}

}

fsdf

{

Console.WriteLine("Level 1 Finished");

}

exit: ;

}

What is the output?

{

Console.WriteLine("Level 1 Finished");

}

exit: ;

}

What is the output?


What is the default access specifier for a Top-level Class, which are not nested into other Classes?


What is the difference between interface and abstract class?


If a method is marked as protected internal who can access it?


The default type of enum is integer and has a default value 1.


Unboxing of a null reference type will return a null.


Which of these string definitions will prevent escaping on backslashes in C# ?


Can we have protected element as a namespace member?

For example:

namespace mine

{

protected class test

{

}

}


Why can’t you specify the accessibility modifier for methods inside the interface?


Can multiple catch blocks be executed for a single try statement? In other words can code inside multiple catch blocks be executed?


































































Description:

This is beginner level test. Take this quiz to test your C# knowledge.

Comments
hunguydm
By: hunguydm
565 days 20 hours ago

Okie, I quickly test and have score 6.79, I see question shoud formatted goodly, sorry my English

aravinth
By: aravinth
559 days 8 hours 58 minutes ago

this is so nice to improve my knowledge and self confident in the programming language.

v.hema
By: v.hema
530 days 11 hours 25 minutes ago

questions are really super

v.hema
By: ComputerGuroo
530 days 11 hours 20 minutes ago

thanks hema

pankaj kumar
By: pankaj kumar
495 days 3 hours 18 minutes ago

it is very easy

Priyank
By: Priyank
489 days 1 hours 50 minutes ago

My score was 11...

sonal
By: sonal
475 days 16 hours 14 minutes ago

goog exam

sonal
By: sonal
475 days 16 hours 10 minutes ago

exilant

sonal
By: sonal
475 days 16 hours 10 minutes ago

exilant

gs
By: gs
431 days 10 hours 40 minutes ago

easy but good

Arun kumar g
By: Arun kumar g
419 days 15 hours 19 minutes ago

really useful

Niraj
By: Niraj
419 days 4 hours 24 minutes ago

nice one

Amit
By: Amit
380 days 2 hours 29 minutes ago

Please review question no 8
Default value for enum is 0 not 1

sass
By: sass
377 days 7 hours 15 minutes ago

Question 13
Which of these string definitions will prevent escaping on the backslashes in C#?
The Correct answer is: string s = @"Test String";

But the Test Quiz says: string s=

ragini
By: ragini
254 days 5 hours 57 minutes ago

very good test

Want to learn?

Sign up and browse through relevant courses.

Name:
Your Email:
Password:
Country:
Contact no:


Area code Number
Subjects you are interested in:
Word verification: (Enter the text as in image)


Sign Up Already a member? Sign In
I agree to WizIQ's User Agreement & Privacy Policy
ComputerGuroo
Microsoft Certified Trainer(MCT) in .NET, SharePoint, SQL Server BI
User
1 Member Recommends
43 Followers

Your Facebook Friends on WizIQ

More Tests By Author

Core JAVA knowledge test.
20 Questions | 1052 Attempts

ASP.NET Test
19 Questions | 1586 Attempts

Indentify the Author of the Quote
10 Questions | 75 Attempts

SQL Server 2008 Beginner to Intermediate leval
13 Questions | 1440 Attempts

Give live classes, create & sell online courses

Try it free Plans & Pricing

Connect