It's good to be able to use someting, it's better to understand how it works.
www.goanation.net
It's good to be able to use someting, it's better to understand how it works.
www.goanation.net
Dave Bloomberg wrote:Thank you for the response
isHospitalized is a methodcall that return true or false? - I dont have the knowladge to answer to this question but i guess it is
I just tried with the setIsHospitalised - it works.
It's good to be able to use someting, it's better to understand how it works.
www.goanation.net
Dave Bloomberg wrote:
is there a way to change isHospitalised permenantly? Right now i can print it out but when i start again they again isHospitalised = false
It's good to be able to use someting, it's better to understand how it works.
www.goanation.net
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
The method addNewPatientToHospital(Patient) in the type Hospital is not applicable for the arguments (ArrayList<Patient>)
at md1.Hospital.main(Hospital.java:155)
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
Cannot make a static reference to the non-static method addNewPatientToHospital(ArrayList<Patient>) from the type Hospital
at md1.Hospital.main(Hospital.java:155)
Be careful to work out what the OP wants to do before suggesting lots of implementation details.Daniel Demesmaecker wrote:. . . You need some kind of database, real or embedded that writes to a textfile
Campbell Ritchie wrote:Be careful to work out what the OP wants to do before suggesting lots of implementation details.
It's good to be able to use someting, it's better to understand how it works.
www.goanation.net
It's good to be able to use someting, it's better to understand how it works.
www.goanation.net
You have done nothing needing apologising for; we see far worseDave Bloomberg wrote:I do apoligise in advance for all the facepalms . . . .
Apology acceptedDaniel Demesmaecker wrote:. . . Sorry, didn't mean to push the op in a direction.
As DB suggested, that may be beyond the scope of the project. If it is necessary to store such data, they will have told him.Just wanted to make clear that without somekind of storage everytime the program starts previous maded changes will be lost
Aaaaaaaaaaaaaaaaaaah! I thought the addNewPatient method should take a single patient, not the whole List.Dave Bloomberg wrote:. . . Unresolved compilation problem:
The method addNewPatientToHospital(Patient) in the type Hospital is not applicable for the arguments (ArrayList<Patient>). . . .
Campbell Ritchie wrote:As DB suggested, that may be beyond the scope of the project. If it is necessary to store such data, they will have told him.
It's good to be able to use someting, it's better to understand how it works.
www.goanation.net
Liutauras Vilda wrote:
How about for improving to this? (beware: example is non-compileable code)
Dave Bloomberg wrote:I am blown away by how active and full of advice givers this forum is. Surely did not make a wrong turn coming here. Thank you all
It's good to be able to use someting, it's better to understand how it works.
www.goanation.net
Daniel Demesmaecker wrote:
Campbell Ritchie wrote:As DB suggested, that may be beyond the scope of the project. If it is necessary to store such data, they will have told him.
...
Dave Bloomberg wrote:
To Campbell, that is a great tip on how I should write my code, i will for sure keep that in mind and try to never use == true / == false ever again as you said that might cause a misspelling issue which is going to cause many other issues with my code.
It's good to be able to use someting, it's better to understand how it works.
www.goanation.net
It's good to be able to use someting, it's better to understand how it works.
www.goanation.net
It's good to be able to use someting, it's better to understand how it works.
www.goanation.net
Congratulations, Dr Frankenstein.Dave Bloomberg wrote:. . . ITS ALIVE!!!
That's a pleasure I presume you have managed to change my Garage and Car example so nobody will know you used itThanks Campbell
Not convinced. I always get suspicious if I see casts, instanceof, or similar. What if the doctor falls ill and has to become a patient? I think I would stick to multiple Lists.Daniel Demesmaecker wrote:If you have a personsList, you dont need a doctor- or patientlist, since they're both persons. You could use the instanceOf method to check of it the object is a patiënt or a doctor.
You mean you would program the first index to be 0. And I still think the ID should be an int. We couldn't see the image; something went wrong with it.
When using the lenght of the list as id keep in mind that the verry First time, so for the first object in the list, you'll have to manully set the id to 0
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |