Answer: </P><P align=justify>From language spec:</P><P align=justify>The list of similarities between classes and structs is as follows. </P><P align=justify>Longstructs can implement interfaces and can have the same kinds of members as classes. Structs differ from classes in several important ways; however, structs are value types rather than reference types, and inheritance is not supported for structs. Struct values are stored on the stack or in-line. Careful programmers can sometimes enhance performance through judicious use of structs. For example, the use of a struct rather </P><P align=justify>than a class for a Point can make a large difference in the number of memory allocations performed at runtime. The program below creates and initializes an array of 100 points. With Point implemented as a class, 101 separate objects are instantiated-one for the array and one each for the 100 elements.
Tags:Interview Questions, Microsoft, C#,
Please submit your Interview Answer for the above Question via replying to this post. Thank you for visiting to our blog, Have a Good Day!.
Sponsor Advertisement
SMS Management System Software
This software used to Send bulk SMS (short text messages) from your computer and assists you to rapidly connect with your customers and staff, communicate with them easily and cheaply, using latest technology that help to generate bulk SMS on just one click to all the database....
No comments:
Post a Comment