Questions tagged as 'protected'

1
answer

How do I access a protected attribute of a package in another package?

I have the animal package with two attributes: name and classification. package heranca; public class Animal{ protected String nome = "Leão"; protected String tipo= "Mamífero"; } ... And I hav...
asked by 02.09.2018 / 19:18
4
answers

Private or protected class in PHP

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...
asked by 22.03.2018 / 20:59
0
answers

Accessing private property with decorator in typescript

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...
asked by 02.01.2019 / 23:31