Kristian
Kristian

Reputation: 1239

Creating an array with objects from another class (Java)

I have created a class Patientjournal which contains a lot of information about various patients in a hospital, as well as methods for retrieving this information.

I have now created another class named Section. In this class I wish to create an array of Patientjournal-objects. I have tried to to this as follows:

private Patientjournal[] patientjournals;

However, this yields the error message

"Patientjournal cannot be resolved to a type".

Why am I getting this message? I don't understand this, because in the actual class Patientjournal, I have successfully been able to create an array with objects from yet another class using the same procedure, and this time without difficulties.

If anyone knows what may cause this I will greatly appreciate any help!

Upvotes: 0

Views: 983

Answers (1)

Clockwork-Muse
Clockwork-Muse

Reputation: 13056

We could use more information, but it sounds like a compiler issue. Specifically, I'm assuming you don't have the necessary import statement; import ext.site.Patientjournal or whatever.

Upvotes: 2

Related Questions