Questions tagged as 'propriedade'

3
answers

Difference between syntax of properties in C # [duplicate]

What I researched, if I did: public int numero { get; set; } is the same as: private int numero; public int Numero { get{ return numero; } set{ numero = value; } } But in the first code snippet every...
asked by 20.07.2017 / 23:29
2
answers

How do I access properties of an object that is inside another object?

In the background I want this output Console.WriteLine(cidade1.casas.dono); to return João using System; namespace arrayteste { public class cidade { public string nome { get; set; } public object cas...
asked by 27.06.2017 / 14:47
2
answers

Create a property for a bool variable that treats string and int

I'm creating a project where I look for the database information, in this case it's a DBF file, and the field is a Logical type. However I want to create a property that can receive a variable (either int, string or bool) and write to the privat...
asked by 04.08.2016 / 17:25
2
answers

Attributes of heirs with prototype do not appear in Javascript reflection

I have class Animal which has some properties that are enumerable: true , ie, I can list them via reflection using for..in . So I have the class Coelho that has the cor attribute. Since rabbit inherits from Anima...
asked by 26.11.2014 / 17:26
1
answer

Save multi-value key in Properties file

I have a .properties file where I load the name of the tests that will be deleted from my application. This file needs to have the same name as the "variables" since they all mean the same thing (excluded tests), the problem is that my co...
asked by 13.11.2017 / 17:04
2
answers

Treat return in class in C #

I have a Mesa class: public class Mesa { public int Cdmesa { get; set; } public int Flsituacao { get; set; } public string Status { get; set; } } I would like to return the Status with the following conditions:    If S...
asked by 28.10.2016 / 17:39
2
answers

Property with private set

Is there a difference between declaring the set private or just omit it? public int UmaPropriedade {get; private set;} public int OutraPropriedade {get;} Are the two lines of code equivalent?     
asked by 03.02.2018 / 12:14
1
answer

Difference between declaration of properties in C # [duplicate]

I'm studying C #, quite a beginner, and I came across one thing, the course I'm doing has video lessons from 2015, and it passes me to create a class with attributes and properties this way: (Tabs and blank lines are my preference to "find me"...
asked by 17.10.2018 / 15:31
2
answers

Can a static method have the same name as a property?

Since a static method is not going to be an object method, can I have a static method with the same name as a property defined inside the constructor?     
asked by 22.08.2017 / 17:58
1
answer

In python, how can I simulate a read-only property in classes?

I'd like to know how I can simulate a read-only property in Python . For example, I have the following code: class IPInfo(object): def __init__(self, ip): self.ip = ip; ip = IPInfo(object) ip.ip = 'aqui é possível edi...
asked by 20.07.2016 / 18:09