Questions tagged as 'classes'

1
answer

Why can not I pass a parameter to the class?

I'm trying to pass the "ink" parameter to the "Pen" class but I can not. I've tried using Boolean expressions instead of index, but still no results. Could someone give me a help ? class Caneta(): açao = 'escrever' def __init__(self...
asked by 02.10.2016 / 20:50
1
answer

Static Members String

I'm trying to create a static member in a class so I do not need to instantiate the class to get the value of the class. In the examples I found on the internet, it references members int . In my case I want the static member to be a...
asked by 22.10.2015 / 23:00
1
answer

Decrease responsibility of a class

Recently I had the need to work with object-oriented sessions and created the following class: <?php /** * @author Mateus Demboski <[email protected]> * @link <https://github.com/mateusdemboski/PHPsessionManager> */ #...
asked by 28.05.2015 / 15:09
2
answers

Call a new IOS class

I'm new to the IOS environment and after studying a bit how the language works, I did not understand how I can call a window / class and superimpose the current window as I do on android. Intent intent = new Intent(a.class, b.class); startActi...
asked by 01.08.2014 / 14:34
1
answer

How to communicate between classes?

I'm starting in JavaFX and I'm having second thoughts. The main class creates an HBox with a button. This button has the action of creating a TableView in the Center of bdPrincipal . Only they are in different classes / packages....
asked by 09.05.2014 / 06:25
1
answer

How to do casting between base and derived classes?

I have an exercise that says I have to create a foundation. This basis has two derivatives. I have to do a cast of the derived class (1) for the derived class (2) and the derived class (2) for the base class. How should I do an exercise like thi...
asked by 02.03.2014 / 14:39
1
answer

How to make this class usable?

In the code below, I would like to return an instance of the class itself with the data filled in through a text file. The lines are stored this way in the file:    Yug Sekwaf, 13-04-1570,2-34,3: 21,2,34,2.45,3.01,2: 01,2: 01,3: 10,2-22 T...
asked by 13.11.2018 / 01:54
2
answers

How to add a class to an HTML element, through JavaScript. In my case, I need to add a class in the h1 element below

I need to add a class in element H1 var div = document.createElement("div"); var h1 = document.createElement("h1"); var p = document.createElement("p"); h1.textContent = "Me Ajuda"; p.textContent = "Preciso adicionar uma classe"; d...
asked by 09.04.2018 / 02:19
1
answer

Python to C ++ conversion

I work on my course with C ++, and wanted to use a Python class variable access feature. Here's an example: class Telefone: nums = {} def __init__(self, numero): self.num = numero Telefone.nums[numero] = self p...
asked by 11.06.2017 / 20:30
1
answer

Difference between List and and Return in Entity

Hello, I have a question when I get the data of a SQL query, there is the possibility of pulling by list and by Entity, what would be the "most correct" or usability of each? public List<Usuario> buscarTodos(Usuario mod){...} public Usua...
asked by 02.08.2016 / 20:58