What is the difference between private string abc = ""; and string abc = ""; ?
Is there a difference or is it just the writing that changes?
I did a test with and without the private and saw no difference, it worked equally.
E...
Studying final methods and classes in the book "Programming in Java 6 ed." of Deitel I came across the following proposition:
The methods declared private are implicitly final, because it is impossible to overwrite them in a subclass (alt...
I'm learning variables public and private .
If I create all the program code, what is the need to create a private variable? Being that enough I do not program a code that accesses the same one of another class.
While r...
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...
The programmer John went there and created a Cliente class and the public double saldo attribute and the Sacar() public method as well.
What is the problem with leaving the double saldo attribute, what would be t...
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?
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...
Is it possible to create a private or protected class in PHP in order to allow access to its variables and functions only to other specific classes?
Application: I have a class where I create a connection to the database and wanted to allow...
In Typescript, is it possible to access a private property by the decorator?
An example of the code I've already done
class A {
@dec
private _teste: string = 'teste'
constructor(){}
public get teste() {
return this._teste...
I'm learning variables public and private .
If I create all the program code, what is the need to create a private variable? Being that enough I do not program a code that accesses the same one of another class.
While r...