unexpected token error

I tried searching but i still dont understand why do i get many unexpected token errors in first and third line ?

public class HeldObject : MonoBehaviour {

    public bool IsColliding { get; private set; }

    private void OnCollisionEnter(Collision collision)
    {
        IsColliding = true;
    }

    private void OnTriggerStay(Collider other)
    {
        IsColliding = true;
    }

    private void OnCollisionExit(Collision collision)
    {
        IsColliding = false;
    }
}

This may be because you are missing the

using UnityEngine;
using System.Collections;

At the start of your code.