您的位置:首页 > 其它

自己总结的一点笔记

2008-12-28 04:07 232 查看
package fuxi1;
//java的参数传递机制
public class Test3 {
   
    //静态方法
   // public static void swap(int a,int b){
  
   //非静态方法
    public void swap(int a, int b) {
        int temp = a;
        a = b;
        b = temp;
        System.out.println(a);
        System.out.println(b);

    }

    public static void main(String[] args) {
        Test3 s = new Test3();
        int a = 6;
        int b = 9;
       
        //静态方法调用 属于类
        //swap(a,b);
       
        //非静态方法调用 对象调用
        s.swap(a, b);

        System.out.println(a);
        System.out.println(b);
    }
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  string class