哦,好吧,我错了。/* * To change this template, choose Tools | Templates * and open the template in the editor. */package javaapplication1;/** * * @author Administrator */ class NewClass { static public void main(String[] args){ System.out.println("dksaljfkasj"); }}
(public,private,protected,default)
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/package javaapplication1;/**
*
* @author Administrator
*/
class NewClass {
static public void main(String[] args){
System.out.println("dksaljfkasj");
}}
如果有PUBLIC类,MAIN()方法必须要放到PUBLIC类中。
定义成PUBLIC的类可以跨包使用,默认不写PUBLIC只能在包内使用。