Hello, I'm creating a subclass from an already defined class. Let's say I have a class called Student and it has a default constructor. Now I want to create a child class of Student, but when I create it, it seems that it's taking the constructor instead of the actual class name

public class Member extends Student {
}

What can I do to fix this?

Recommended Answers

All 3 Replies

class student looks like this

public class Student {
  int age;
  public Student (int age){
       this.age = age;
  }
}

Thanks for the link, and sorry I missed it

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.