Hello, I'm still new to Java and I have a certain problem in my code.
I've made 2 classes (Person and Group) and 1 demo (Which is used for testing my classes).
Person works perfectly fine when I use it along with my demo.
Though, I'm having a bit of trouble importing/using certain methods from Person in Group.
The problem is that I do not know how to import/use a method from another class in my Group class (Yes I'm a beginner).
For example:
In my Person class
I need to pass on the (getNumMem) Method into my Group class to be used.
The error message I get when trying to run this in Group is:
cannot find symbol - method getNumMem();
So, I was wondering if any of you could kindly explain to me how I would be able to do this?
~Your help is greatly appreciated!
I've made 2 classes (Person and Group) and 1 demo (Which is used for testing my classes).
Person works perfectly fine when I use it along with my demo.
Though, I'm having a bit of trouble importing/using certain methods from Person in Group.
The problem is that I do not know how to import/use a method from another class in my Group class (Yes I'm a beginner).
For example:
In my Person class
I need to pass on the (getNumMem) Method into my Group class to be used.
Code:
public int getNumMem(){
return numMem;
}
cannot find symbol - method getNumMem();
So, I was wondering if any of you could kindly explain to me how I would be able to do this?
~Your help is greatly appreciated!
Comment