- Structure is a generalization of a user-defined data type (UDT)-Value type.
- Structure is created when you want a single variable to hold multiple types of related data.
- Structure is declared by using the keyword struct.
- Structures can also include methods as its members like classes.
- The member access levels possible are only public, internal, private.
E.g.: struct Book
{
public string title;
public string author;
public Book(string title, string author)
{
this.title = title;
this.author = author;
}
}
0 comments :
Post a Comment