Questions tagged as 'classes'

1
answer

Class definition within a function or another class

I've seen in some scripts definitions of classes within other classes or functions like this: class Grok(object): class Foo(object): ... ... What is the reason for this practice? Is it just to not allow direct instantiatio...
asked by 09.07.2018 / 06:46
1
answer

Classes and php variable scope

Well, my question is more about how to reference and "get" the contents of a variable in a PHP Class. See excerpts from the code below, where I put wrong data for the connection, on purpose, to cause an exception to the PDO, and thus store the e...
asked by 08.09.2018 / 05:45
1
answer

Pointers of non-existent classes in C ++, how does it work?

Sometimes I run into situations like this: #ifndef CRIARVENDA_H #define CRIARVENDA_H #include <QDialog> #include "cliente.h" namespace Ui { class CriarVenda; } class CriarVenda : public QDialog { Q_OBJECT public: explicit Cri...
asked by 18.12.2017 / 18:39
2
answers

Return DataHora Updated Android

I made a class called DataHoraAtual containing this data: package com.projeto.projetov1.model; import java.text.SimpleDateFormat; public class DataHoraAtual { long date = System.currentTimeMillis(); SimpleDateFormat sdf = new SimpleD...
asked by 16.12.2017 / 23:28
1
answer

Error @Path and @Produces in Java

Error using @Path in Java. package resource; import java.util.ArrayList; import java.util.List; import java.nio.file.Path; import java.nio.file.Paths; import domain.Album; import domain.Banda; import domain.Musica; import jdk.nashorn....
asked by 10.01.2018 / 20:21
2
answers

Use of the "Instance of"

public class AlunoLicenciatura extends Aluno{ private String curso; private ArrayList<Disciplina> l_dis; public AlunoLicenciatura(String curso,Aluno a){ super(a.getNumero(),a.getNome());//recebe o numero e o nome de al...
asked by 26.11.2017 / 22:47
1
answer

Why does this strange result appear when printing the values defined in the class? (Python)

Well, I created this class (Car class), then set the values for each argument of that class. But when printing the variable with the already defined values, this appears: #isso é o que aparece ao imprimir a variável car1 <Car object at 0x7f...
asked by 08.10.2017 / 18:08
1
answer

Class declaration in C #

At what other levels of access can I declare a class in C # in addition to public and private . I found these levels in the Microsoft site : protected internal protected internal     
asked by 16.09.2017 / 15:26
2
answers

What is the best method to access a member of a class?

What is the best method to access a member of a class in terms of speed and organization? class cMinhaClasse { public: void Funcao(int r); }; int main() { // Método 1 - Acessando classe por ponteiro cMinhaClasse *mClasse = new cMi...
asked by 22.09.2017 / 18:55
1
answer

Get and Set using PROPERTY - Python3

As a property learning object, I created a small currency converter. See: class converteMoeda(): def __init__(self, dollar=0, real=0): self.dollar = dollar self.real = real def toDollar(self): dollar = self.real/self.dolla...
asked by 28.06.2017 / 16:44