zoukankan      html  css  js  c++  java
  • Some notes in Stanford CS106A(2)

    1.Local variable(local)

    ex. int i = 0; factorial(i);

    the "i" outside the method factorial(i) is called local variable ; and the "i" in method factorial(i) is a copy of the "i" outside

    instance variable(ival) local variable(local)
    declared in class  declared in method
    visable in entity object vis in method
    lives ala object lives lives in method
    state  local competition

    2.Class variable(static variable)

    A variable that is shared by all objects of that class.

    ex.public static int Counter; 

    IF "Counter" is setting to another num, the one who used the class which include the Class var , will get the new num.

    like ,

    Public class ClassCounter {
        public ClassCounter (){
            counter=1;
        };
        public ClassCounter (int count){
            counter=count;
        };
        public int getnum(){
            return counter;
        }
        private static int counter;
    }
    ...
    ClassCounter counter1 = new ClassCounter(); 
    ClassCounter counter2 = new ClassCounter(1000); 
    println(counter1.getnum());
    //the printout is 1000

    3.Javadoc for ACM libraries

    http://jtf.acm.org/javadoc/student/

    4.getters and setters----the difference with public:

        setter is used to make sure the value we want to set is right, if not right ,we can prevent changing the value. (more details please refers to other docs. like     

        https://www.cnblogs.com/Jac440682/p/6752152.html

    5.stacking order(z-order) sth. used in acm.graphics(略,非重点)

  • 相关阅读:
    chrome开发者工具使用方法。
    模拟window的history对象
    浏览器后退刷新(通过浏览器按钮)
    日常口语十
    日常口语九
    日常口语八
    日常口语七
    日常口语五
    日常口语五
    日常口语四
  • 原文地址:https://www.cnblogs.com/wleaves/p/10496142.html
Copyright © 2011-2022 走看看