CS 1112 Lecture Notes - Lecture 24: Object-Oriented Programming

53 views2 pages

Document Summary

Class properties: default values can be specified within the properties section of the class definition. This specifies the type of the property: properties for a class object are assigned within the constructor method, there are usually the same number of parameters in the constructor class as there are properties. If default values are specified for properties, they do not have to be assigned within the constructor. If properties can be calculated from one or more other variables, less parameters may be used: class properties can be of the type of another class. Hiding data: data can be hidden from users using object oriented programming, error("some message here") displays an error message, private class variables can only be accessed within a class definition. Define right after the properties key word. Properties (access = private: public variables and methods can be accessed from other programs, get methods return the value of a property. Use get methods whenever it is possible.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents

Related Questions