Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Classes and Methods
#1

Classes and Methods
Access Modifier
Public
Private
Protected
Internal
Public
The public keyword is an access modifier for types and type members.
Public access is the most permissive access level.
There are no restrictions on accessing public members.
Protected
The protected keyword is a member access modifier.
A protected member is accessible from within the class in which it is declared, and from within any class derived from the class that declared this member.
Internal
The internal keyword is an access modifier for types and type members.
Internal members are accessible only within files in the same assembly.
Private
The private keyword is a member access modifier.
Private access is the least permissive access level.
Private members are accessible only within the body of the class or the struct in which they are declared.
Classes and Objects
A class combines together
Data
Class variables
Behavior
Methods
A key feature of object- oriented languages
Procedural languages, such as C, did not require clustering of data and behavior
Class/instance distinction
Class defines variables & methods
Need to create instanced of the class, called objects, to use variables & methods
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

Powered By MyBB, © 2002-2024 iAndrew & Melroy van den Berg.