zoukankan      html  css  js  c++  java
  • Java小代码

    1.

    public class test1 {public static void main(String[] args) {

    Person P = new Person("gdsgds");
    System.out.println(P.name);//输出为null
    }
    }
    class Person{
    String
    name;
    int age;
    public Person(){

    }
    public Person(String name){

    }
    }

    2.class SDText{

      static SDText sd =new SDText();            加载静态区   第一句    第二句    第三句

      static int x=3;          sd         null          0x001    0x001       0x001

      static int y;            x            0    1     3    3

      public SDText(){         y            0    1    1    1

        x++;

        y++;

    }

    }//输出x=3  y=1

    3.

    class SDText{

      SDText sd =new SDText();    

      int x=3;       

      int y;         

      public SDText(){      

        x++;

        y++;

    }//StackOverflowError

  • 相关阅读:
    菜农大叔抢楼
    实验室博客
    VS2008加入QT
    9G关于新唐M0的ISP的要点
    内部函数和外部函数
    51串口通信
    一个三位整数反向后输出
    C++重载函数定义和用法
    博客记录
    C语言练习笔记更新
  • 原文地址:https://www.cnblogs.com/akic/p/10673457.html
Copyright © 2011-2022 走看看