Some notes in Stanford CS106A(2)

wleaves 2019-03-08 原文

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(略,非重点)

 

发表于 2019-03-08 15:30 苏悠莫 阅读() 评论() 编辑 收藏

 

版权声明:本文为wleaves原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/wleaves/p/10496142.html

Some notes in Stanford CS106A(2)的更多相关文章

  1. stanford Protege 4.3 ERROR: Bundle org.protege.common 解决方法 – Wonder奇迹奇迹

    stanford Protege 4.3 ERROR: Bundle org.protege.common 解 […]...

  2. Some notes in Stanford CS106A

    Some notes in Stanford CS106A Karel world 1.During make […]...

  3. AWS CSAA — 01 Introduction To The Course

    1. 为什么要学习AWS认证? 2. AWS认证的考试是如何组织的? 3. 你需要做些什么? 4. 关于CSA […]...

  4. Some notes in Stanford CS106A(3)

    Some notes in Stanford CS106A(3) 1.If ( str1==str2 )  m […]...

  5. django.db.models.fields.related_descriptors.RelatedObjectDoesNotExist: Course has no coursedetail.

    错误描述:   一对一反向查询失败!   前提:   Course和CourseDetail    OneTo […]...

  6. (Stanford CS224d) Deep Learning and NLP课程笔记(一):Deep NLP – 公子天

    (Stanford CS224d) Deep Learning and NLP课程笔记(一):Deep NLP […]...

  7. Stanford NLP学习笔记:7. 情感分析(Sentiment)

    1. 什么是情感分析(别名:观点提取,主题分析,情感挖掘。。。) 应用: 1)正面VS负面的影评(影片分类问题 […]...

  8. Stanford coursera Andrew Ng 机器学习课程编程作业(Exercise 1)

    Exercise 1:Linear Regression—实现一个线性回归 在本次练习中,需要实现 […]...

随机推荐

  1. 虚拟机添加磁盘LVM分区

    参考博客:http://kimjinlsgd.blog.51cto.com/1918030/932210 一、 […]...

  2. Jenkins Java 反序列化远程执行代码漏洞(CVE-2017-1000353)

    Jenkins Java 反序列化远程执行代码漏洞(CVE-2017-1000353) 一、漏洞描述 该漏洞存 […]...

  3. 2015年蓝桥杯B组C/C++决赛题解

    2015年第六届蓝桥杯B组C/C++决赛题解 点击查看2015年第六届蓝桥杯B组C/C++国赛题目(不含答案) […]...

  4. 3月15第一次课

    内容: 1.C语言的编译过程   源文件.c  >>预编译>>  预编译文件.i    […]...

  5. Bootstrap学习笔记(5)–实现Bootstrap导航条可点击和鼠标悬停显示下拉菜单

    Bootstrap学习笔记(5)–实现Bootstrap导航条可点击和鼠标悬停显示下拉菜单 实现B […]...

  6. Android 开发一定要看的15个实战项目

    前言: 虽说网上有太多的Android课程,但是大多都是视频,有Android在线开发环境的几乎没有,但是对于 […]...

  7. Background-position的妙用 – 陈希章

    Background-position的妙用 在网页中,我们会用到大量的图片,其中大部分是作为背景存在的。大家 […]...

  8. eclipse新建python项Project interpreter not specified

    安装好pydev后新建python项目时提示”Project interpreter not specifie […]...

展开目录

目录导航