java的一些基本格式

书写方法的格式:

 

修饰符     返回值            方法名                  方法体

public     int/void    addNumber(参数)      {          } 

例子:

public  int  addNumber (int a,int b)   {          }

 

书写类的格式:

class  Student{ 

  

代码 (方法)

 

}

原文地址:https://www.cnblogs.com/liyihome/p/3664788.html