--%>

How class and a structure are different

How class and a structure are different?

E

Expert

Verified

a.) Class:

  • The class is a reference type.
  • During instantiating the class, CLR assigns memory for its instance in heap.
  • Class supports inheritance.
  • Variables of the class could be allotted as null.
  • It can contain constructor or destructor.


b.) Structure:

  • The structure is a value type.
  • Memory is assigned on stack.
  • It does not support inheritance.
  • Members of Structure could not have null values.
  • It do not need constructor or destructor and members could be initialized automatically.

   Related Questions in Programming Languages

  • Q : Define the term Swizzling Define the

    Define the term Swizzling: It is the process of recursively writing the contents of an object through object serialization.

  • Q : What is an Instruction set Instruction

    Instruction set: The set of instructions which characterize a specific Central Processing Unit. The programs written in the instruction set of one type of CPU can’t usually be run on any other kind of CPU.

  • Q : Define the term Method signature Define

    Define the term Method signature: This is the synonym for method header.

  • Q : Define the features of DTD Define the

    Define the features of DTD?

  • Q : Features and advantages of UNIX Specify

    Specify the features and advantages of the UNIX?

  • Q : Describe Layout manager Layout manager

    Layout manager: The object responsible for sharing the accessible space between multiple components in a graphical container.

  • Q : Explain different cursors types in ADO

    What are the different cursors types in ADO and illustrated them?

  • Q : Use of UpdateProgress control in AJAX

    What is the use of UpdateProgress control in AJAX?

  • Q : State Default label Default label : The

    Default label: The destination for all values employed in a switch statement expression which do not contain explicit case labels. The default label is not obligatory.

  • Q : Distinct features of Object oriented

    Q. What are the distinct features of Object oriented programming language?  

    Discover Q & A

    Leading Solution Library
    Avail More Than 1415974 Solved problems, classrooms assignments, textbook's solutions, for quick Downloads
    No hassle, Instant Access
    Start Discovering

    18,76,764

    1947407
    Asked

    3,689

    Active Tutors

    1415974

    Questions
    Answered

    Start Excelling in your courses, Ask an Expert and get answers for your homework and assignments!!

    Submit Assignment

    ©TutorsGlobe All rights reserved 2022-2023.