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

  • 相关阅读:
    [bzoj1113][Poi2008]海报PLA
    [CF1111D]Destroy the Colony
    [CF1111E]Tree
    [CF1111C]Creative Snap
    [洛谷P5136]sequence
    [洛谷P5190][COCI 2010] PROGRAM
    [洛谷P5137]polynomial
    US Open 2016 Contest
    【hackerrank】Week of Code 26
    usaco中遇到的问题
  • 原文地址:https://www.cnblogs.com/akic/p/10673457.html
Copyright © 2011-2022 走看看