help my code has error CS8205 :parsing error how can I fix?

I coded a script exit the game on the press of the esc key but it came up with CS8205: parsing error i know how this is caused but i can not work out how to fix it please help i am quite new to unity.Here is the code can someone correct it please?

// Update is called once per frame
public void Update() {
if (Input.GetKeyDown(KeyCode.Escape)) {
    Application.Quit();
}

}

no that’s just a typo that’s not in the code I have edited the post to get rid of that now.

You got a bracket to close your if, you got another one to close your Update function, but you need one more to close your class.

You implied the class definition, but it should look like this:

using UnityEngine;
using System.Collections;

public class myClass: Monobehaviour {

void Start () {


}

void Update () {

if (Input.GetKeyDown(KeyCode.Escape)) {
    Application.Quit();
}

}

} // You're missing this one.