Why are my MonoBehaviour methods not called?

I have the following very simple code; the script is attached to my game character:

class NeuralNetController extends MonoBehaviour
{

    function Start()
    {
    	Debug.Log("Start called");		
    }

    virtual function Update()
    {
    	Debug.Log("Update called");
    }
}

but it does not work - that is, neither method gets called. When I remove the class syntax, like this:

function Start()
{
    Debug.Log("Start called");		
}

virtual function Update()
{
    Debug.Log("Update called");
}

then it works fine. Do I have the syntax wrong? Or should I extend from another class? Or is there something else going on?

Just as an experiment, I also added the virtual keywords to the function declaration of the first example; that too, did not work.

(If you are wondering why I don't simply use the second method - since it works - it is because I actually need to extend from another class that extends from MonoBehaviour. I just took out the irrelevant detail.)

Most likely the script is not named exactly 'NeuralNetController', which it must be if you extend the monobehaviour. The class name and script file name must match, if you use C#, it will tell you this. I dropped your script into unity and renamed it appropriately, and it worked perfectly.

The javascript compiler is unfortunately very prone to letting you make unintended mistakes. For this reason alone, I highly recommend using C#. It's syntax is more strict, and for that reason, you will end up making fewer mistakes from simple typos, as the compiler will gently warn you, instead of silently doing something unintended.

using UnityEngine;
using System.Collections;

public class NeuralNetController : MonoBehaviour{

void Start(){
    Debug.Log("Start called");              
}

public virtual void Update(){
    Debug.Log("Update called");
}

}