Types, Classes, and Objects
Types, Classes, and
Objects
•Type
–C# has more than one type of
number
–int type is a whole number
–floating-point types can have a
fractional portion
•Types are actually implemented through
classes
–One-to-one correspondence between
a class and a type
–Simple data type such as int, implemented as a class
•Instance
of a class → object
•A
class includes more than just data
•Encapsulation
→ packaging of data and behaviors into a single or unit→class
Comments
Post a Comment