Chapter 7 Flashcards

1
Q

What are properties

A

It allows us to access class members in a protective manner.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are indexers

A

Its a feature of C# language that allows to behave any class of C# like an array. It means the instances of that class can be called like [ ] (indexes could be integer or string)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the difference between struct and class

A

stuct are value type and class is reference type. In struct we can not inherit implementation. There are no default constructor and destructors in struct.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the difference between value type and reference type

A

Reference type have copies and value type there is no copy and original stuff moves

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are interfaces

A
Interface is declaration of methods and properties. There is no implementation of it. e.g. 
test() {
// no code here, only method signature
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How to declare an interface

A
interface IMyInterface {
void MethodToImplement();
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are 4 things an interface have

A

Events
Indexers
Properties
Methods Implementation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Can one interface inherit another interface

A

Yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly