error CS0116: A namespace can only contain types and namespace declarations C#. Whats wrong here?

i got this Error "error CS0116: A namespace can only contain types and namespace declarations"
the errors are at (19,17) and (24,17).

using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class playerMoney : MonoBehaviour {

    public int money;
    public Text moneyText;
	// Use this for initialization
	void Start () {
        money = 10;
        moneyText.text = money.ToString;
	}
	
	// Update is called once per frame
	void Update () {
	
	}
}
    public void addMoney (int moneyToAdd)
{
    money += moneyToAdd;
    moneyText.text = money.ToString;
}
    public void subtractMoney (int moneyToSubtract) { 
    if (money - moneyToSubtract < 0) {
        Debug.Log("Not EnoughMoney!");
   } else {
        money = moneyToSubtract;
        moneyText.text = money.ToString;
    }
}
}

Where did i done goof?

You’re curly brace usage was closing the class definition then you started defining more methods outside of the class.

Here is a reformatted and corrected class definition for you:

using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class playerMoney : MonoBehaviour 
{
	public int money;
	public Text moneyText;
	// Use this for initialization
	void Start () 
	{
		money = 10;
		moneyText.text = money.ToString;
	}

	// Update is called once per frame
	void Update () 
	{

	}
	
	public void addMoney (int moneyToAdd)
	{
		money += moneyToAdd;
		moneyText.text = money.ToString;
	}

	public void subtractMoney (int moneyToSubtract) 
	{ 
		if (money - moneyToSubtract < 0) 
		{
			Debug.Log("Not EnoughMoney!");
		} 
		else
		{
			money = moneyToSubtract;
			moneyText.text = money.ToString;
		}
	}
}