0
Extend a class without an constructor
Hey there, I'm new to java and I tried to make some nukkit plugins(mc bedrock edition server plugins). When I try to extend some classes, like the player class. My ide is showing an error and tell me to use the parent constructor. Is there an way to do it without using that parent constructor? So I fixed my self for now with an extra variable and don't extend from that class. Thx for help :)
3 Answers
0
class A {
A(int a) {System.out.println(a);}
}
class B extends A {
B(int a) {super(a);}
}
public class Program {
public static void main(String[] args) {
B b = new B(100);
}
}
0
Yea I figured out my self. So that won't work for my situation/problem, but thx.
0
it is better with question to publish the part of your code too