Questions tagged as 'visibilidade'

1
answer

Reasons to use private class

When I started in the area, in an OOP course the teacher explained about access modifiers ... I remember that the same day he said that it would be possible to create a private class, but he did not see a reason for doing so. Why can you d...
asked by 11.04.2018 / 21:59
4
answers

Why different objects of the same class can access private fields from one another?

Today while I was doing a course in Udacity (Intro to Java Programming) I thought about this in the Update the class Person exercise (lesson 3 29/45). In object-oriented modeling we have the concept of encapsulation (hide implementation...
asked by 26.08.2016 / 14:09
2
answers

Private class in JavaScript

I'm looking for a way to make both attributes and methods invisible so they are not accessible from outside the class. But I also wanted to use the modern approach to do this (classNameClass {}). After many attempts I have taken a different appr...
asked by 08.09.2018 / 16:01
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

Declare public variables in the __construct

Look at the example method: <?php #noticia_construct.class.php class Noticia{ public $titulo; // Acredito que não seja necessário public $texto; // Acredito que não seja necessário function __construct($valor_tit, $valor_txt){...
asked by 02.11.2016 / 19:02
2
answers

Why does not a private method go into the documentation in Java?

Why does not a method have a void modifier as it does not appear in the documentation? As soon as I put the public it appeared in the documentation. Is there any more modifier that interferes with this?     
asked by 14.01.2018 / 00:39
1
answer

Private class in C #

I have a class Pessoa.cs private , but I can call it in another class, for example I created a class called Parametro.cs ; I can instantiate the class private Pessoa without the slightest problem. Should not priva...
asked by 01.06.2018 / 13:16
1
answer

What is the default visibility of a variable in TypeScript, what is the importance of var when declaring variables?

When declaring a variable, when we omit the visibility parameter (public, private, and protected) the variable is created by default in what visibility? export class AddEditTaskPage { idade: number; valor: string; .... Just one more qu...
asked by 22.09.2018 / 19:46
2
answers

Doubt visibility of attributes in the class diagram

We recently had an in-class discussion on the issue of attribute visibility in the class diagram. Some have stated that in the diagram (as well as in the code) all attributes must be private. However, the teacher made the following observation:...
asked by 13.04.2017 / 02:44
3
answers

Undefined reference compiling with g ++

I usually use g ++ to compile my code, but now that I've started to learn template I can not compile for anything, the following error appears: g++ -c pilha.cpp pilha-infinita.cpp g++ pilha.o pilha-infinita.o -o pilha.exe pilha-inf...
asked by 26.03.2015 / 15:06