experimenting with text based game - problem with classes

I am checking if I'll be able to work with classes/text based game/input method. in the below example I am creating two things - a Character called "John" and an Object called "wood". and I have a variable for string (string_entry) which if will be "take wood" the "wood" will appear on John's inventory list. at leaast that's the plan. can you see what I am doing wrong here? I recieve three errors: -the type Object does not have a visible constructor that matches the argument list (String) //while I think it's obvious that it does * and in the line before "print" I see two errors- "unknown identifier "John" and "wood".

what's wrong here?

class Character{
    function Character(n:String){
        name = n;
        inventory = new List.<String>();
    }
    var inventory;
    var name:String;
}

class Object{
    function Object(n:String){
        name = n;
    }
    var name:String;
}

function Start(){
    var John = new Character("John");
    var wood = new Object("wood");
}

var string_entry = " ";
function Update () {
    if(string_entry == "take wood"){
        John.inventory.Add(wood.name);
        print("john acquired some wood");
    print(John.inventory[0]);
    }
}

First error is that your class for objects is called Object, which is already taken by System.Object and UnityEngine.Object. I would really recommend swapping to a different name

Second error is that you're declaring John and wood at the scope of Start - what you should do is move the decleration outside the function:

var John : Character;
var wood : Whatever;

function Start(){
    John = new Character("John");
    wood = new Whatever("wood");
}