Questions tagged as 'herencia'

1
answer

Use of instance attribute inherited from parent class

I have the following code: from PyQt5.QtWidgets import QMainWindow,QApplication from PyQt5 import uic class Primera(QMainWindow): def __init__(self): QMainWindow.__init__(self) uic.loadUi("Inicio.ui",self) self.pr...
asked by 01.08.2018 / 05:52
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

Navigate array accessing attributes of child classes

I have an array of type Relacion , which is filled with objects of type Binario . Binario inherits Relacion . How can I get the values of the attributes of binary objects? Relacion exprs[] = { new Binario(Operador...
asked by 26.08.2017 / 02:45
0
answers

Functions with dynamic_cast

I must carry out a program, which is a clinic which has a list of the Pregnant class, which is a base class from which pregnant women are derived. Pregnant women, pregnant women, pregnant women, mothers35 and pregnant women, high blood. I must i...
asked by 24.11.2018 / 02:02
0
answers

Send the subclass as an argument in the super constructor

If a class in your constructor calls super(/*argumentos*/); , how do I send it to itself? (Likewise as a parameter, what else could be sent? And I know that the subclass, the superclass can not call super(); (at least not in my exam...
asked by 30.06.2017 / 21:44
4
answers

NullPointerException when adding a "Vehicle" in Java

I'm practicing a bit of Java, so I set out to do a little program to add Vehicles and inheritance. But clicking on the "Load" button throws me a NullPointerExcpetion . My code for the Load button: String nombreTitular = txtNombreTit...
asked by 28.07.2016 / 23:16
3
answers

Inheritance in grails

I am developing an application in grails and I need to represent an inheritance between two entities. The problem is that when I establish the relationship: class Documento { static mapping = { tablePerHierarchy false } class Tesi...
asked by 30.03.2016 / 23:28
1
answer

Access the daughter class from the father | Java

I have an abstract class Publicaciones and two child classes: Libro and Revista . I have a ArrayList of Publications, where I keep objects Libro and objects Revista , but when accessing the attributes o...
asked by 03.12.2016 / 16:20
2
answers

Is it mandatory to call the constructor of the base class from the constructor of a class inherited from it?

My problem is the following, when inheriting from a class (Base, whether abstract or not) which has one or more constructors defined explicitly I am forced to call some of them in any constructor that defines the derived class because if I do no...
asked by 24.02.2018 / 02:16
1
answer

Error with Java inheritance POO Exception in thread "main" java.lang.RuntimeException: Uncompilable source code

What happens is that we are learning the subject of inheritance and they sent us a simple exercise, which tries to add a person and then list the people added, the part of adding a person is good for me, the problem is to list the people added,...
asked by 06.11.2018 / 00:12