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...
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...
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...
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...
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){...
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?
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...
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...
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:...
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...