Questions tagged as 'classes'

0
answers

Call a member function prepare () on null in

I picked up this class that connects to MySql via PDO, in that link . It works correctly. But I decided to turn it into a static class. And here is the modified code. class db { private static $dsn; private static $username; priva...
asked by 20.04.2016 / 21:43
2
answers

Instantiate class in a library by method in arduino

I have this line of code, and in it I have 2 methods, where one sets the keypad and another one takes the key pressed. void Maleta::setKeypad(int r1, int r2, int r3, int r4, int c1, int c2, int c3, int c4){ const byte numRows= 4; // Numero d...
asked by 15.09.2015 / 19:29
1
answer

POO with PHP $ _POST [closed]

How should a value of the super global $ _POST be entered into a class. I have tried many ways, but to no avail. This value will be treated within the class.     
asked by 25.05.2015 / 14:27
1
answer

Problems converting Session to Class in C #

I have the following variable List<MyFile> xmlDisponivel = new List<MyFile>(); This variable is a list of the following class public class MyFile { public string FileName { get; set; } public string FilePath { get; set...
asked by 21.02.2017 / 15:32
3
answers

How to simplify these two methods?

Well, in my class there are two magic methods, add and sub: def __add__(self, other): if other.__m == self.__m and other.__n == self.__n: result = [] for i in range(other.__m): lst = [] for j in ra...
asked by 04.12.2018 / 22:21
3
answers

How to import all static variables from another class?

I have two classes, A and B . The A class needs to access all existing static variables in B . How to do this import? I found a lot with get , however it does not look like this. I'm a beginner and I'm lost.     
asked by 04.07.2017 / 17:55
3
answers

Javascript function when clicking on any class="xpto"

I have a calendar where every day is: <a class="dia" href="#">(Número do dia, ex: 1, 2, 3, etc)</a> I did this below, but the problem is that I can only choose 1 class, I want it to work with either: <a class="dia"...
asked by 12.07.2017 / 19:49
2
answers

Interface with the same name as a class

namespace path; interface test{ public function method(); } class test{ } class foo implements test{ } When writing the above code a fatal error is returned: Cannot declare class path\test, because the name is already in use in ......
asked by 11.01.2016 / 17:57
2
answers

Why calling a method is not compiling?

using System; using System.IO; namespace testando { public class pessoa { public void Falar(){ Console.WriteLine("Ola meu nome é ninguem"); } } class Program { public static void Main(strin...
asked by 02.09.2018 / 15:34
1
answer

Error: expected {when creating a class

I wrote the code below but it is giving me the error    Expected { After my class declaration public class book(string title, string text){ string _title = title; string _text = text; void NewTitle (book livro, string newtit...
asked by 28.09.2015 / 23:33