Questions tagged as 'clase-abstracta'

3
answers

Abstract class with constructor

Can a clase abstracta of Java have constructor ? And if so, what are your goals?     
asked by 02.12.2015 / 13:55
3
answers

Query about the reserved word "super ()" JAVA

Good afternoon, in my project I have the following attributes and constructor of an Abstract Class: //Attributes private int number; //Constructor public Card ( int number ) { this.number = number ; } Of which inherits the following C...
asked by 27.04.2017 / 21:21
2
answers

Doubt about Polymorphism

I have an Abstract class Vendible (with attributes name, price and identifier) and two classes that inherit from it Products and Package, Package is going to be formed by an array of products and the advantage is that it has a discount of 20 % o...
asked by 03.12.2016 / 00:52
1
answer

PHP problem with abstract classes and protected functions

As the title says, I have a problem with the following code. abstract class AClass { abstract protected function a1(); abstract protected function a2(); public function show() { return $this->a1() . "<br>" . $this...
asked by 28.01.2017 / 14:41
1
answer

How can I use an implementation of an interface, only including the .hpp of the interface?

Main.cpp #include <iostream> #include "IWrittingDevice.hpp" #include "IFactory.hpp" int main(int argc, char const *argv[]) { IFactory* factory = 0; IWrittingDevice* device = factory->create(0); device->Write(); de...
asked by 30.08.2018 / 14:23
1
answer

Object arrangement by several Classes?

I am a beginner in terms of OOP, and right now I am doing a code for a veterinarian where I have to make an arrangement of objects and put animal data. This is the parent class (which, as you can see is Abstract) package veterinaria;...
asked by 22.04.2018 / 18:07
1
answer

Problem with abstract class and interfaces

I have written the class code, but it does not work out. Specifically, in the methods CalularSaldoCC and CalularSaldoCA error occurs that does not recognize MontoApertura . Also, I do not know whether to move it to Cuan...
asked by 14.11.2016 / 00:06
1
answer

Inheritance Uncaught ArgumentCountError: Too few arguments to function

I have problems with the child class constructors. In this case I have an abstract ACCOUNTS class. From it inherits CURRENT ACCOUNT and in turn it inherits ACCOUNTNOWABILITY . When wanting instances CURRENT ACCOUNT AND ACCOUNT CONVERTIBILIT...
asked by 06.09.2018 / 16:39
1
answer

Error with fix in abstract class (Client is abstract; can not be instantiated)

I have an abstract class called Client with two subclasses. In the main file (called TestClient) I need to make an array but when I try to start it it gives me the message "Client is abstract; can not be instantiated". // Arreglo de client...
asked by 24.10.2017 / 11:39