hello!
how to convert a null value into null object in C# ?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Abhishek JaiswalPosted May 10, 2014, 2:37 PM
can u please tell me how to do with other code parts like
patient.cs and other.
Anupam SinghPosted May 10, 2014, 5:11 AM
you specified below method in Hospital Class :
But private ArrayList listOfDoctors; and private ArrayList listOfPatients; are global for Hospital class and its need not to use :
hospital.listOfDoctors.Add(new Doctor("Ben Casey", 32, 3, "Ear, Nose, Throat"));
you can simply use listOfDoctors.Add(new Doctor("Ben Casey", 32, 3, "Ear, Nose, Throat"));
for this or another methods.
and there is no need to specify these methods as static.
Abhishek JaiswalPosted May 10, 2014, 3:42 AM
i waana apply these 2 things over my code-
- refactoring
- null value into null object
can u please solve this.
(code is attached)
Anupam SinghPosted May 10, 2014, 3:23 AM
My question to you :what is the need of doing this.It might be interesting if you share ..
is this what you were looking for
object o=(object)null;
dynamic d=(object)null;