latest Post

C# Interview Questions on Data Types

C# Interview Questions on Data Types

Q : What are the 3 types of comments in C#?

Ans : 1. Single Line Comments. You define single line comments with // as shown below.

//This is an example for single line comment


2. Multi line comments. You define multi line comments with /* */ as shown below.

/*This is an example for Multi Line comments*/


3. XML Comments. You define XML comments with /// as shown below.

///This is an example for defining XML comments.

Q : What are the 2 broad classifications of data types available in C#?

Ans : 1. Built in data types.

2. User defined data types.

Q : Give some examples for built in datatypes in C#?

Ans : 1. int

2. float

3. bool

Q : How do you create user defined data types in C#?

Ans : You use the struct, class, interface, and enum constructs to create your own custom types. The .NET Framework class library itself is a collection of custom types provided by Microsoft that you can use in your own applications.

About Mallikarjun A

Mallikarjun A
Recommended Posts × +

0 comments:

Post a Comment