C# Programming - Interfaces - Discussion

Discussion Forum : Interfaces - General Questions (Q.No. 3)
3.
A class implements two interfaces each containing three methods. The class contains no instance data. Which of the following correctly indicate the size of the object created from this class?
12 bytes
24 bytes
0 byte
8 bytes
16 bytes
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
15 comments Page 1 of 2.

Amol said:   1 decade ago
If function has size 4 then it get multiplied to 6=24

Parul sahu said:   1 decade ago
I didn't understand.

Mukesh said:   1 decade ago
How can I understand the size of function which is created ?

Neelam said:   1 decade ago
Tell size of function which is created?

Abc said:   1 decade ago
Is there any restriction on size of the function?

Aishik said:   1 decade ago
The answer has to be 0byte....u dont know what is the predefined storage of the methods...initially it is 0....

Shubham said:   1 decade ago
No memory is allocated because there are no instance are created.

Size of the instance (object) is depended how much variable are initialized in the given class and inherits classes.

Asish Kumar Satpathy said:   1 decade ago
The moment the object of the given class is initialized, the reference to those functions inside both the interfaces will occupy the memory. In C#.Net reference is of 4bytes.

Hence 4Bytes*3(1st interface)+4Bytes*3(2nd interface)=24Bytes

Lakshmi Reddy Yeluri said:   1 decade ago
Good explanation Asish Kumar.

Thanks..!

Manish said:   1 decade ago
Class is initialized only then only reference is made. So, how the class will be initialized?

How class will be initialized without object creation. I mean to say how this class will be called from main method?


Post your comments here:

Your comments will be displayed after verification.