Back to Freecodecamp

Getters and Setters

curriculum/challenges/english/blocks/advanced-oop-concepts/getters-and-setters-video.md

latest486 B
Original Source

--description--

In this video, you will learn about getters and setters.

--questions--

--text--

What is a setter?

--answers--

A function that automatically deletes an object when it goes out of scope.


A method that retrieves or reads the value of an attribute.


A method in a class used to set or update the value of a private or protected attribute.


A method that creates a new class instance without modifying any attributes.

--video-solution--

3