Questions tagged as 'poo'

1
answer

Why can not I create two sub-levels within an object?

var objeto = { sub1_A: {}, sub1_B: {}, sub1_C: {} } I have no problems if I do the following: objeto.sub1_A.sub2 = "Prueba"; But yes if I descend a level more directly: objeto.sub1_A.sub2.sub3 = "Prueba"; If I try to set the...
asked by 28.08.2018 / 15:39
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 defining the methods of a class

I have this date.h , where I have a class Date . I define my methods and then implement them in a date.cpp but the compiler throws me errors of:    error: "method ...." previously defined here. and error: redefinition of "m...
asked by 02.09.2017 / 03:49
2
answers

Exceptions in Java

I would like to know how to create my own exception to control that the notes only have the rank of 1 to 10, that if it is not fulfilled skip a message Code: System.out.println("Introduca fecha de nacimiento"); do{...
asked by 27.08.2017 / 12:53
1
answer

System.NullReferenceException: 'Object reference not set as an instance of an object.' [duplicate]

I would like if someone could help me with the following question. I'm doing a test program in which there is a textbox in which names are inserted, these names must be saved in an array and then pressing another button that those names go to...
asked by 05.11.2018 / 22:43
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
1
answer

Why does not the return work for me? JAVA POO

I was doing a calculator, but when I call the add, subtract, etc. method, it does not return its result. The rest of the methods I put them type void and to their result I put it in a system.out.println , I do not know he must do that, bec...
asked by 03.12.2018 / 19:44
1
answer

How to implement Enum in java, poo

I'm starting to see the issue of enum in java and I have an exercise in which I'm asked to check which quadrant of the Cartesian plane are certain points, these points are stored in an ArrayList and the teacher told me to Through a enu...
asked by 27.09.2018 / 05:50
1
answer

Difference when initializing values of a class?

I have a class with too many variables, I need to initialize the values empty depending on the type of data, I see that I can do it in two ways: public class Documento { public Document() { Tipo = ""; Numero = ""; }...
asked by 19.09.2018 / 21:44
2
answers

javascript event handler

I'm wanting to use custom events for Javascript , and the truth is that I try to find something but either I can not find the indicated information or I do not understand it, so it occurred to me to do my eventManager , quite truthfu...
asked by 19.12.2016 / 15:31