Master Summoner
- Joined
- Oct 9, 2008
- Messages
- 572
- Reaction score
- 14
The thing is that I'm reading Big Brother's free e-book on C# for sharp kids, which I should understand more or less, but I'm headed into a problem that the book doesn't describe. I've created a class called Animal, just like in the book, and added some strings, integers and booleans, and then I tried to make another class, in a namespace, where I try to make a new Animal object, but I'm getting this error: "'Animal.kindOfAnimal' is inaccessable due to its protection level"
I tried to play around with it, but it doesn't seem to change, and yes I'm utterly new to C#.
Heres my source:
I tried to play around with it, but it doesn't seem to change, and yes I'm utterly new to C#.
Heres my source:
PHP:
using System;
class Animal
{
string kindOfAnimal;
string name;
int numOfLegs;
int heigth;
int length;
int age;
bool hasTail;
}
namespace progRun
{
class run
{
public static void Main()
{
Animal Cat;
Cat = new Animal();
Cat.kindOfAnimal = "Cat";
}
}
}