Questions tagged as 'poo'

2
answers

Operator overload + in C ++

I can not get the operator +, how can I overload the operator + to add the value of two dice and return an integer with the result? This is the class: class Dado{ private: int dado_; public: Dado(); Dado(int valor); inline int ge...
asked by 23.08.2018 / 23:17
1
answer

Are the data of the variables or objects initialized in the constructor method stored in RAM directly?

That is: If I initialized an object "x" in the constructor method, will I have quick access to it when I use it somewhere in my code? Is it stored directly in RAM? Or is there a buffer between the RAM and the JAVA virtual machine? As well as a k...
asked by 22.11.2018 / 01:19
1
answer

Problems working with PHP Classes

I am working with classes in php and it gives me the following error Deprecated: Non-static method EnlacesModels::EnlacesModel() should not be called statically, assuming $this from incompatible context in /home/u430635434/public_html/travel-...
asked by 02.03.2018 / 22:11
1
answer

Save a table from a bd in a datatable and scroll through your information while taking your data

My problem is that I have a table from which I want to take all the fields and convert them into an object. What happens is that I only take the first data of the query I want and I do not know how to go through it. My code is the following W...
asked by 13.02.2018 / 20:19
1
answer

Polymorphism and Inheritance in Java

They commissioned me a job in which I must use the polymorphism and inheritance of POO, the problem is that of 4 "values" that I want to show only shows me 2, I would like to know if someone could give me an alternative for this, not It is somet...
asked by 14.02.2018 / 21:56
1
answer

Problem with num_rows

Good afternoon, I have this code that is supposed to give me the number of books in the database, but it does not work. public function getTotalBooks() { $sql = $this->db->prepare("SELECT * FROM libros"); $res...
asked by 13.06.2017 / 20:05
2
answers

How do I go through a list?

How do I go through a list? how do I go through the data of it as such to a Jframe window called purchases ... from a control I load a list in a Jframe but I would like to know how to go through it with what code it is done?     
asked by 13.04.2017 / 02:06
2
answers

What would be the best way to handle the firing rate of the ships in my game?

In my current code the enemy ships fire each frame of the game. How can I make those shots to be every so often, 2 seconds for example? My code: Bullet.h: class Bullet { private: sf::Sprite sprite; sf::Vector2f speed; int posX, posY;...
asked by 04.05.2017 / 21:25
2
answers

C ++ array bound is not an integer

Hello, I'm doing a program that manages the entry and printing of data of employees of a company This is my code: #include <iostream> #include <stdlib.h> #include <windows.h> #include <conio.h> #define TECLA_ARRIBA...
asked by 03.01.2017 / 20:17
1
answer

PHP class upload

Greetings to all, I come again with a problem that I have with self-loading classes with spl_autoload. This is my Autoloader class: class Autoloader { static public function CargarClases($className) { $filename = "../classes/" ....
asked by 15.12.2016 / 15:24