java 中成员变量的名字和类的方法的名字可以一样.

public class fourone {
    
    public static void main(String[] args) {
        int first[]={1,2,3};
        for(int i=0;i<first.length;i++)
        {
            System.out.println(first[i]);
            
        }
        int [] s={1,2,3};
        for(int i=0;i<s.length;i++)
        {   
            System.out.println(s[i]);
            
        }
        
        fourone o=new fourone();
    fourone.kk z=    o.new kk();
    z.abc();
    
        
        // TODO Auto-generated method stub

    }
    
    public class kk
    {
        public int abc=33;
        public void abc()
        {
            System.out.println("abcddd");
            System.out.println(abc);
            
        }
        
    }


}

 

相关文章:

  • 2021-10-26
  • 2021-09-26
  • 2022-12-23
  • 2021-12-05
  • 2021-09-14
  • 2023-02-17
  • 2022-12-23
  • 2021-11-29
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-22
  • 2022-12-23
  • 2022-12-23
  • 2022-01-11
  • 2022-12-23
相关资源
相似解决方案