Questions tagged as 'encapsulamento'

2
answers

Real example of using encapsulation

I researched encapsulation, I even read some topics here, but I have not yet seen a real example of using it in a way that shows me its advantages, what issues it avoids. I have an attribute of type public , but it is customary for prog...
asked by 24.04.2018 / 22:42
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

Doubt over access modifiers and polymorphism

I have a very early question about polymorphism / access modifiers in Java. I would like to find out why a certain phenomenon occurs in my code. Here is an example of classes: Class Pai : public class Pai { public void metodo1(...
asked by 09.11.2017 / 19:00
1
answer

How to use variables in a location outside the scope where they were created?

I have the following code: public class TracoActivity extends Activity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_traco); int mc = 15;...
asked by 26.12.2014 / 07:31
2
answers

Doubt about attributes initialized in the constructor in Java

package Livraria3; public class Livro { private String nome; private String descricao; private double valor; private String isbn; Autor autor; public Livro(Autor autor) { this.autor = autor; this.isbn =...
asked by 05.07.2015 / 05:10
1
answer

Encapsulation, Functions - Function call per String

I have a problem checking to see if a particular function exists. Code - Similar. if(jQuery){ (function(jQuery){ jQuery.extend(jQuery.fn, { exemplo: function(o){ var chartError = false;...
asked by 01.07.2015 / 15:05
1
answer

How to reference instance variable with the same name as a local variable in C ++?

In C ++, how can I reference an instance variable that has the same name as a global variable? For example, in a set method of the following class: class Person { private: string name; public: void setName(string name) {...
asked by 23.10.2017 / 00:09
1
answer

Class declaration in C #

At what other levels of access can I declare a class in C # in addition to public and private . I found these levels in the Microsoft site : protected internal protected internal     
asked by 16.09.2017 / 15:26
1
answer

Java Academic System [closed]

Hello .. I need help setting up a Java program with the following specifications: 1) Read the following items from the user: Name (String), Age (int), Genre (char [M or F]), Phone (String), Address (String), cpf (String), rg (String), Neighbo...
asked by 16.08.2016 / 03:41
1
answer

How to determine the access level of the elements of a class?

This is a competition issue from Secitec 2018 for the position of computer teacher. I have recourse with respect to this issue because there are no qualifiers, but access modifiers such as: private, protected and public. The reserved word "packa...
asked by 25.04.2018 / 00:26