Simple screenshot that explains the non-static invocation.
Here is the code:
- /*
- Instance invocation in the memory:
- */
- package kju.obj;
- import static kju.print.Printer.*;
- public class NonStaticInvoke {
- public static void main(String[] args) {
- Person p = new Person("lily");
- p.setName("lucy");
- }
- }
- class Person {
- public static final String country = "cn";
- private String name;
- public Person(String name) {
- this.name = name;
- }
- public static void showCountry() {
- println("country = " + country);
- }
- public void setName(String name) {
- this.name = name;
- }
- }
The figure below corresponds to the above code:
Simple screenshot that explains the non-static invocation.的更多相关文章
- Simple screenshot that explains the singleton invocation.
Here is the code: /* Some class,such as a config file,need to be only one.So we need to control the ...
- recursive - simple screenshot but detail principle.
the code below demonstates the principle of the'recursive-call' that the programing beginner may be ...
- 关于java的static关键字
通常来说,当你创建类时,就是在描述那个类的对象的外观与行为.除非你用new创建那个类的对象,否则,你实际上并未获得任何东西.当你用new来创建对象时,数据存储空间才被分配,其方法才供外界调用. 但是有 ...
- php Late Static Bindings延迟静态绑定
官网说道: As of PHP 5.3.0, PHP implements a feature called late static bindings which can be used to ref ...
- selenium2截图ScreenShot的使用
截图是做测试的基本技能,在有BUG的地方,截个图,保留失败的证据,也方便去重现BUG.所以,在自动化的过程中,也要能截图,也要能在我们想要截取的地方去截图,且能在错误产生时,自动的截图. 示例: 脚本 ...
- Standard C++ Programming: Virtual Functions and Inlining
原文链接:http://www.drdobbs.com/cpp/standard-c-programming-virtual-functions/184403747 By Josée Lajoie a ...
- Burp Suite教程(英文版)
In this article, we are going to see another powerful framework that is used widely in pen-testing. ...
- Understanding Network Class Loaders
By Qusay H. Mahmoud, October 2004 When Java was first released to the public in 1995 it came wit ...
- 高性能服务器设计(Jeff Darcy's notes on high-performance server design
高性能服务器设计(Jeff Darcy's notes on high-performance server design 我想通过这篇文章跟大家共享一下我多年来怎样开发“服务器”这类应用的一些想法和 ...
随机推荐
- 2016 年开发者应该掌握的十个 Postgres 技巧
[编者按]作为一款开源的对象-关系数据库,Postgres 一直得到许多开发者喜爱.近日,Postgres 正式发布了9.5版本,该版本进行了大量的修复和功能改进.而本文将分享10个 Postgres ...
- 《More Effective C++》 条款5 谨慎定义类型转换函数
---恢复内容开始--- C++编译器能够在两种数据类型之间进行隐式转换(implicit conversions),它继承了C语言的转换方法,例如允许把char隐式转换为int和从short隐式转换 ...
- nginx -- 安装配置Nginx
安装说明 系统环境:CentOS-6.3 软件:nginx-1.2.6.tar.gz 安装方式:源码编译安装 安装位置:/usr/local/nginx 下载地址:http://nginx.org ...
- 【转】LaTeX 符号命令大全
函数.符号及特殊字符 声调 语法 效果 语法 效果 语法 效果 \bar{x} \acute{\eta} \check{\alpha} \grave{\eta} \breve{a} \ddot{y} ...
- MT9v024总结
S1: A typical READ or WRITE sequence begins by the master sending a start bit. After thestart bit, t ...
- 一个Tomcat及一个ip,绑定不同的域名,各个域名访问各自不同应用程序的配置方法
http://nickandmiles.blog.163.com/blog/static/23422123201110151492166/ 条件是:这样一种实际情况是,就一台服务器,当公网的IP地址也 ...
- 正经学C#_变量与其转换:《c#入门经典》
上一节上了变量.末尾简单了说了下 命名方式,声明变量. 命名方式在C#,或者任何语言都是非常重要的一门学问.值得去深入思考一下.变量名的优化与其工作效率的提升,有很多大的关系的. 声明变量,上节介绍了 ...
- scrapy使用代理
import base64 # Start your middleware class class ProxyMiddleware(object): # overwrite process reque ...
- struts2学习笔记(2)---Action中訪问ServletAPI获取Map类型的Servlet元素
源码: strust.xml <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts ...
- 廖雪锋笔记1---python变量类型
整型:a/b a//b a%b 浮点型:.2 字符串: "" '' r"" r'' '''...''' r'''...'''' 变量值共享:写时复制 NULL型 ...