//继承的一般声明: calss A extends SuperA
///接口的一般声明: interface A
///类的声明: {修饰词} class 类名 {}
///类的方法的声明: [修饰词] 返回值 方法名 (参数列表){}
///类的方法的使用:
public class Hello
{
public void sayhello()
{
System.out.println("Hello");
}
}
public class Test1
{
public static void main (String[] args)
{
Hello hello=new Hello();
hello.sayhello();
}
}
/// 构造方法
public calss Test2
{
int a,b;
public void Test2()
{
a=1;
b=2
}
public void Test2(int c,int d)
{
a=c+d;
b=c-d;
}
}
原文:http://www.cnblogs.com/weiweiyi/p/5232080.html