-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Learning Object-Oriented Programming
By :
So far, we have been working with simple classes and used them to generate instances in Python and C#. We also defined the functions of a constructor to generate objects based on prototypes in JavaScript. Now, it's time to dive deeper to understand the different members of a class.
The following list enumerates all the possible element types that you can include in a class definition. We already worked with many of these elements:
You already learned how constructors and destructors work in Python and C#. We also worked with constructor functions in JavaScript. So far, we have been using instance fields, also known as instance attributes, to encapsulate data in our instances. We can access these fields or attributes without any kind of restriction as variables within an instance...
Change the font size
Change margin width
Change background colour