darth monkey
darth monkey2y ago

C# help

im trying to type this code, but i have problems with using pet1.PetName, but i have declared them earlyer in my code
No description
3 Replies
DirtyJ
DirtyJ2y ago
You'll need to use getters and setters for those private variables E.g.
getPetName(){
return PetName;
}
setPetName(string name){
PetName=name;
}
getPetName(){
return PetName;
}
setPetName(string name){
PetName=name;
}
Intellisense on VS might be able to auto generate those for you
darth monkey
darth monkeyOP2y ago
thanks man
DirtyJ
DirtyJ2y ago
Np Salute