Questions tagged as 'classes'

2
answers

Where is the class constructor in Python?

Definition of Wikipedia.    The builder is a method   which is generally responsible for allocating the necessary resources to the   of the object beyond the initial definition of the variables of   status (attributes). In Python the...
asked by 23.01.2016 / 01:26
2
answers

What happens with class name resolution in php 5.5?

PHP 5.5 has implemented a new feature, which consists of getting the class name through the keyword class : Example: namespace testando; class Teste{} echo Teste::class; // testando\Teste; This works correctly, as expected. Now...
asked by 24.06.2014 / 19:37
2
answers

How does hierarchy elements in css work? [duplicate]

I would like to know how the hierarchy works in css, I explain: Let's say in my style.css I set to h1, h2, h3, h4, etc. by default font-size: 12px; , so far beauty ... Now, if for example I insert inside a class...
asked by 19.04.2018 / 19:06
2
answers

How to check if a constant exists in the class or in a namespace?

In PHP, to check if a constant exists we use the defined function. As below, for the two cases of constant declaration: const MY_TEST_1 = 'my test 1'; define('MY_TEST_2', 'my test 2'); var_dump(defined('MY_TEST_1'), defined('MY_TEST_2...
asked by 19.06.2015 / 14:06
2
answers

How to set a private property in Python? Is there protected property?

I come from PHP. In it, when we want to define a property of a class as private we add the keyword private in its declaration. Example: class StackOverflow extends StackExchange { private $language = 'en'; // privado, só pode ser...
asked by 04.03.2015 / 20:56
1
answer

Enum is expanded by the compiler into a class declaration?

Does Enum expand by compiler into a class declaration in Java?     
asked by 08.12.2016 / 14:23
1
answer

Difference class and interface [duplicate]

What is the difference between class and interface and when should I use one or the other?     
asked by 22.06.2016 / 03:35
1
answer

Can a class be a data type?

What I understand about data type is that they are formed by three properties, they are: Address set; Operations Set; Memory Space; Assuming what is above I can understand that a class I create for example class Pessoa : pub...
asked by 17.02.2016 / 01:04
2
answers

Is it possible for an attribute of a class to be the class itself?

I'm starting to learn% object-oriented%, and I have to do an algorithm using threaded lists. In C++ , I used a structure that had as one of the attributes a pointer to the structure itself. I would like to know if it is possible to do some...
asked by 23.09.2016 / 16:17
1
answer

Make a generic vector in Java

How to create a dynamic vector in Java with generic programming? This vector must have an initial size of size 4 and be enlarged as new elements need to be inserted. The class must have: Standard Builder. Constructor with initial vector...
asked by 05.05.2016 / 16:23