Top "Getter-setter" questions

Public mutator methods in object-oriented programming, responsible for changing and returning the value of private class members, thus keeping with the principle of encapsulation.

Using @property versus getters and setters

Here is a pure Python-specific design question: class MyClass(object): ... def get_my_attr(self): ... def set_my_attr(self, …

python properties getter-setter
c#: getter/setter

I saw something like the following somewhere, and was wondering what it meant. I know they are getters and setters, …

c# getter-setter
What's the pythonic way to use getters and setters?

I'm doing it like: def set_property(property,value): def get_property(property): or object.property = value value = object.property …

python getter-setter
Property getters and setters

With this simple class I am getting the compiler warning Attempting to modify/access x within its own setter/getter …

swift properties compiler-warnings getter-setter
C++ getters/setters coding style

I have been programming in C# for a while and now I want to brush up on my C++ skills. …

c++ coding-style getter-setter
Is it possible to read the value of a annotation in java?

this is my code: @Column(columnName="firstname") private String firstName; @Column(columnName="lastname") private String lastName; public String getFirstName() { return …

java annotations getter-setter java-6
Instance member cannot be used on type

I have the following class: class ReportView: NSView { var categoriesPerPage = [[Int]]() var numPages: Int = { return categoriesPerPage.count } } Compilation fails with …

swift instantiation getter-setter computed-properties
Generate getters and setters in NetBeans

I Need to know how to have NetBeans generate getters and setters using a shortcut.

java netbeans keyboard-shortcuts getter-setter
Looking for a short & simple example of getters/setters in C#

I am having trouble understanding the concept of getters and setters in the C# language. In languages like Objective-C, they …

c# setter getter getter-setter
Do you use the get/set pattern (in Python)?

Using get/set seems to be a common practice in Java (for various reasons), but I hardly see Python code …

python getter-setter