Questions tagged as 'classes'

2
answers

require_once does not work

I'm trying to give require_once in a PHP file that has a class. The file I'm trying to include in PHP with the class has only one array with configuration data, but I can not get it properly. class CoreDatabase { public $database;...
asked by 14.11.2017 / 18:29
2
answers

Change return type

How do I change the return type of a parent class function in the child class? For example: class Mother { public: void Get() {} }; template <typename Type> class Child : public Mother { public: Type Get() { // TODO...
asked by 21.09.2017 / 03:14
1
answer

Get a class that has a certain interface implemented in generics [closed]

Hello. I want to do something like metodo(Class<? extends ClasseAbstrata> classe) , except that an abstract class, I want to use a interface , but if I change from extends to implements eclipse starts to point...
asked by 24.06.2016 / 23:51
1
answer

Calculation to buy fuel by value?

I'm doing a fuel pump program using classes, but I'm not sure how to calculate the amount of fuel for the value entered, can anyone give a light? class BombaCombustivel(): def __init__(sel, tipoComb, valorLitro, quantComb): self.t...
asked by 01.11.2016 / 00:02
2
answers

How to pass the value of a variable through a button to another class in Swift

I have a login screen, with the fields email and password. I need to use in another viewController the email that was used to log in to the system. But I can not pass the typed email in the viewController Login to another viewController.     
asked by 16.05.2016 / 01:17
2
answers

How to reuse data in a class without having to repeat this data?

How to reuse $dados , $key and $postFields on all methods without having to repeat this data every time within each method? Yes, these variables will always have the same values. class AllImoveis { /** * Chaves de...
asked by 26.12.2015 / 13:46
1
answer

How to split the addressing of a class in PHP?

What is the best way to split this Aluno ? <?php class Aluno{ private $nome; private $sobrenome; private $email; private $telefone; private $cep; private $rua; private $ender...
asked by 12.12.2018 / 18:25
1
answer

How to instantiate a PHP class

Generally to instantiate and use a class in my project, I use: include ('arquivo_que_contem_a_classe.php'); $obj = new obj(); $obj->nomedafunction(); But today I needed an already ready class downloaded from github via composer, which...
asked by 07.08.2018 / 00:01
2
answers

Problem when importing a class from another folder and using it. (Python)

I'm going crazy here. I'm facing a problem that should have been solved by logic already. The problem is this: I have two folders: novapasta / novapasta / classes In the first folder there is a file: novapasta / main.py In the...
asked by 16.07.2018 / 00:31
1
answer

Calling a method

Hello, I'd like to do something extremely simple, but I'm having trouble applying. I made the following class: public class nome { string aluno = "Olá, eu sou um aluno"; string aluna = "Olá, eu sou um outro aluno"; }...
asked by 19.06.2018 / 03:11