Implement setters and getters for the character type.
Represent properties, which are used to read, write, or compute a private field. These methods are usually public and allow you to access data
class Shirt
{
string material = "cotton";
}
First class keyword, then the class name, then a set of brackets, and within the brackets, and then create the variable
1/18
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Implement setters and getters for the character type.
Represent properties, which are used to read, write, or compute a private field. These methods are usually public and allow you to access data
class Shirt
{
string material = "cotton";
}
First class keyword, then the class name, then a set of brackets, and within the brackets, and then create the variable
Delegate
An event to have an object signal an action's occurence.
Events go inside delegates, which provide a way to design and execute callbacks
Subscriber
A class that receives an event notification
EventHandler
Is a built-win delegate, which is a representative of a method with a particular parameter list and data type
Access Modifier : protected
If you want your data to be accessible by members of all derived classes
Access Modifier : private
Access Modifier : public
Access Modifier : derived
To instantiate a class
AreaRect areaRect1 = new AreaRect();
get
This method should replace the comment // access the private field. Is used to access a private field from within a public field
set
This method is used to assign a value to a private field
Public/Private Constructor
Is not needed when setting or returning a private variable
Generic Classes
Have operations that are not specific to a data type
Are used collections such as stacks, queues, hashed tables, and linked lists.
Have generic methods
Base Class
There is no set limit for how many classes can be derived from this class
Child Class
Cannot inherit from multiple parent classes
Derived Class
A class that inherits functionality from a base class
Abstract Class
Cannot be used to create objects.
Serves as a base for other classes to use its methods and have these classes have their own objects and methods
Interface
Contain abstract methods, meaning without a body
A class serves as a base for an interface
Can be implemented without using the override keyword