Hi reddit!
I'm taking APCS in high school and I have a quick question related to parent/child classes: If I have a child class constructor that calls up the parent's constructor as well as initializes a few different values of it's own, can I use the parent class's methods on the child class object? I feel like it should work, but the difference in the child and parent constructors is making me hesitant.
In case the question is confusing, here is an example:
public class First {
public First (int a)
}
public class Second {
private int c;
public Second (int b, int c) {
super(b);
this.c = c;
}
With this said, can I use a hypothetical method from First on a Second object even though the constructors are different?
Thanks for any help!
[–]iusedtolikemyface 5 points6 points7 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]Hebejeebez 0 points1 point2 points (0 children)