java的编程出现错误,请大家帮帮忙,谢谢!



import java.util.Scanner;

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/

/**
*
* @author Jack ONE
*/
public class mainClass {
System.out.println("你好!");

}
提示
请肢誉悔雹写在main函数里。。。

public static void main(String[] args) <-----这历前段才是main函数
public class mainClass {
public static void main(String args[]){
System.out.println("让友你好!坦蚂槐"物带);
}
}
怎么能直接在类里面写输出呢,应该写到方法里啊。
需写在方法中才可运行