Questions tagged as 'propriedade'

1
answer

Understanding the pythonic way of dealing with properties

I'm trying to figure out how this python properties issue works. But the problem is that in all the net tutorials out there I only find the damn example with only one attribute. I'm looking for an example where you have more to do with day to da...
asked by 01.07.2015 / 01:56
1
answer

When to use magic method __contructor or set and get

My question is regarding builder, for example, I have a class with name, age. the correct one is to use __constructor to pass values to them or use set and get?     
asked by 28.12.2014 / 04:10
2
answers

What would this "k_BackingField"

I'm having a project to create a Smart Device in C # for Windows CE. I received a reverse engineering result code, but it has a part that I can not understand or adapt. Here is the code: private string <codProduto>k__BackingField; privat...
asked by 14.06.2018 / 06:00
3
answers

In a data class can you have properties other than those generated automatically?

Kotlin allows you to simplify the creation of what we call POJO in Java: data class Person(val firstName: String, val lastName: String) We get a class with the getter for all variables declared in the constructor as well as the methods...
asked by 11.08.2017 / 20:00
1
answer

Access modifier property C #

I noticed that it is possible to sign the access mode of a property as private: public string Codigo { get; private set; } Or just ignore it: public string Codigo { get; } Is there a difference or some scenario where one of these signa...
asked by 10.04.2016 / 17:29
1
answer

What is lazy instantiation?

I saw here in the Wakim answer that code snippet: data class Person(val firstName: String, val lastName: String) { val fullName: String by lazy { "$firstName $lastName" } } What is this lazy instantiation ?     
asked by 12.08.2017 / 00:40
1
answer

Pass arguments to the property getter

VB.NET allows you to declare parameters in the property getter Public ReadOnly Property Propriedade(param As String) As String Get Return param & "!" End Get End Property It's a strange feature and in C # it does not work. What...
asked by 26.10.2017 / 20:04
2
answers

How to transform attributes into properties?

In C #, I can avoid using getter and setter , turning the attributes into properties, as below: public class Pessoa { public int pes_idade { get; set; } public string pes_nome { get; set; } } Can you do this in Java?  ...
asked by 26.08.2016 / 20:36
1
answer

How to use expanded property in C #

I have a problem, I created a class containing the following property: public class MinhaClasse { public int Idade {get; set;} } However, when I do this: public class MinhaClasse { public int Idade { get{ return Idade;...
asked by 16.12.2017 / 22:06
3
answers

Why is the behavior of the undefined variable different from undefined property?

I've noticed this a long time ago in Javascript. If I write a particular code where the variable is not defined in any scope, an exception is thrown: console.log(preco) Result:    Uncaught ReferenceError: price is not defined But...
asked by 26.10.2016 / 15:55