Skip to Content
JavaScript : Object-Oriented Programming
book

JavaScript : Object-Oriented Programming

by Kumar Chetan Sharma et al
August 2016
Beginner to intermediate
847 pages
17h 28m
English
Packt Publishing
Content preview from JavaScript : Object-Oriented Programming

Encapsulating data in C#

First, we will add fields to a class in C# and then use access modifiers to hide and protect a specific member of a class from unauthorized access. We will use property getters and setters to control how we write and retrieve values to and from related fields.

We will work with auto-implemented properties to reduce the boilerplate code. We will use methods to add behaviors to classes and create the mutable and immutable version of a 3D vector to understand the difference between an object that mutates state and an object that doesn't.

Adding fields to a class

The SmoothFoxTerrier class is a blueprint for dogs that belong to the Smooth Fox Terrier breed. This class should inherit from a Dog superclass, but we will forget ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

JavaScript: Functional Programming for JavaScript Developers

JavaScript: Functional Programming for JavaScript Developers

Ved Antani, Simon Timms, Dan Mantyla
Mastering JavaScript Object-Oriented Programming

Mastering JavaScript Object-Oriented Programming

Andrea Chiarelli, Lyubomyr Rudko

Publisher Resources

ISBN: 9781787123595Supplemental Content