Classes vs. Structures - DOT.NET

Classes vs Structures.

ClassesStructures
It is used for large amounts of data.It is used for smaller amounts of data.
It can be inherited.It cannot be inherited.
It can be NULL.It cannot be NULL like the class.
It can have destructor.It cannot have destructor.
It can be abstract.It cannot be abstract.
The keyword for class is 'class'.The keyword for structure is 'struct'.
Class member variables are private by default.Structure members have public access by default.
It contains a volatile field.It cannot contain volatile field.
Fields are automatically initialized.Fields are not automatically initialized.
You cannot use of sizeof operator.You can use sizeof operator.
Syntax:
class <Class_name>
{
static void main(string[ ] args)
{
//Statements
}
}
Syntax:
struct <Structure_name>
{
//variable_declaration
};
Example:
class A
{
static void main(string[ ] args)
{
//Statements
}
}
Example:
struct Student
{
int rollno;
char stud_name;
char address;
};
What is the role of data provider? - DOT.NET
The .NET data provider layer resides between the application and the database. Its task is to take care of all their interactions...
Explain how to filter and sort data with the DataView component - DOT.NET
One of the ways to sort and filter data is to use the ‘select’ method. However, our focus is on the DataView object...
What is DataViewManager? - DOT.NET
DataViewManager can be used to manage view settings of the tables in a DataSet...
Post your comment