Posts by skidils • 135 points
6 posts
-
0
votes1
answer170
viewsQ: subclass does not incorporate super class method
This is the first time I’ve had this mistake. I have the Class Loja that extends into several subclasses. problem is that subclasses do not "ask" the super method Shop: public abstract class Loja {…
-
1
votes1
answer122
viewsQ: How to have an Arraylist by composition
I understand how to compose but I’ve never done with lists, although the principle should be the same, I don’t understand how to do. For starters I have a class CentroComercial who owns a ArrayList…
-
2
votes1
answer249
viewsQ: How to count the number of all instances of a class and their respective subclasses?
I have a class A, where A extends into B and in C. I have a counter of instances in A. public Class A { ... private int nInstancias = 0; ... public A(){ nInstancias+=1; ... } ... public int…
-
2
votes2
answers143
viewsQ: How to program according to good OO design practices?
I did this program, simple and nothing complicated. My problem is that although this is doing exactly what I want, it does not follow correct patterns of object-oriented design. What should I do to,…
-
1
votes2
answers235
viewsQ: Reset variable every time you switch to a method
I’m making a simple program that inserts at the first possible position of a vector, a String. This is the code I have: import java.util.Formatter; import java.util.Scanner; /** * * @author…
-
5
votes2
answers1339
viewsQ: How to convert negative decimal numbers to hexadecimal
I was able to pass an integer number to hexadecimal. The problem now being tested is that the negative numbers do not work with this formula. This is the code I have: public class PPROG_pl6_ex8 {…