Here is the code:

  1. /*
  2. Instance invocation in the memory:
  3.  
  4. */
  5. package kju.obj;
  6.  
  7. import static kju.print.Printer.*;
  8. public class NonStaticInvoke {
  9. public static void main(String[] args) {
  10. Person p = new Person("lily");
  11. p.setName("lucy");
  12. }
  13. }
  14.  
  15. class Person {
  16. public static final String country = "cn";
  17. private String name;
  18. public Person(String name) {
  19. this.name = name;
  20. }
  21.  
  22. public static void showCountry() {
  23. println("country = " + country);
  24. }
  25.  
  26. public void setName(String name) {
  27. this.name = name;
  28. }
  29. }

The figure below corresponds to the above code:

Simple screenshot that explains the non-static invocation.的更多相关文章

  1. 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 ...

  2. recursive - simple screenshot but detail principle.

    the code below demonstates the principle of the'recursive-call' that the programing beginner may be ...

  3. 关于java的static关键字

    通常来说,当你创建类时,就是在描述那个类的对象的外观与行为.除非你用new创建那个类的对象,否则,你实际上并未获得任何东西.当你用new来创建对象时,数据存储空间才被分配,其方法才供外界调用. 但是有 ...

  4. php Late Static Bindings延迟静态绑定

    官网说道: As of PHP 5.3.0, PHP implements a feature called late static bindings which can be used to ref ...

  5. selenium2截图ScreenShot的使用

    截图是做测试的基本技能,在有BUG的地方,截个图,保留失败的证据,也方便去重现BUG.所以,在自动化的过程中,也要能截图,也要能在我们想要截取的地方去截图,且能在错误产生时,自动的截图. 示例: 脚本 ...

  6. Standard C++ Programming: Virtual Functions and Inlining

    原文链接:http://www.drdobbs.com/cpp/standard-c-programming-virtual-functions/184403747 By Josée Lajoie a ...

  7. Burp Suite教程(英文版)

    In this article, we are going to see another powerful framework that is used widely in pen-testing. ...

  8. Understanding Network Class Loaders

    By Qusay H. Mahmoud, October 2004     When Java was first released to the public in 1995 it came wit ...

  9. 高性能服务器设计(Jeff Darcy's notes on high-performance server design

    高性能服务器设计(Jeff Darcy's notes on high-performance server design 我想通过这篇文章跟大家共享一下我多年来怎样开发“服务器”这类应用的一些想法和 ...

随机推荐

  1. 2016 年开发者应该掌握的十个 Postgres 技巧

    [编者按]作为一款开源的对象-关系数据库,Postgres 一直得到许多开发者喜爱.近日,Postgres 正式发布了9.5版本,该版本进行了大量的修复和功能改进.而本文将分享10个 Postgres ...

  2. 《More Effective C++》 条款5 谨慎定义类型转换函数

    ---恢复内容开始--- C++编译器能够在两种数据类型之间进行隐式转换(implicit conversions),它继承了C语言的转换方法,例如允许把char隐式转换为int和从short隐式转换 ...

  3. nginx -- 安装配置Nginx

    安装说明 系统环境:CentOS-6.3 软件:nginx-1.2.6.tar.gz 安装方式:源码编译安装  安装位置:/usr/local/nginx  下载地址:http://nginx.org ...

  4. 【转】LaTeX 符号命令大全

    函数.符号及特殊字符 声调 语法 效果 语法 效果 语法 效果 \bar{x} \acute{\eta} \check{\alpha} \grave{\eta} \breve{a} \ddot{y} ...

  5. MT9v024总结

    S1: A typical READ or WRITE sequence begins by the master sending a start bit. After thestart bit, t ...

  6. 一个Tomcat及一个ip,绑定不同的域名,各个域名访问各自不同应用程序的配置方法

    http://nickandmiles.blog.163.com/blog/static/23422123201110151492166/ 条件是:这样一种实际情况是,就一台服务器,当公网的IP地址也 ...

  7. 正经学C#_变量与其转换:《c#入门经典》

    上一节上了变量.末尾简单了说了下 命名方式,声明变量. 命名方式在C#,或者任何语言都是非常重要的一门学问.值得去深入思考一下.变量名的优化与其工作效率的提升,有很多大的关系的. 声明变量,上节介绍了 ...

  8. scrapy使用代理

    import base64 # Start your middleware class class ProxyMiddleware(object): # overwrite process reque ...

  9. struts2学习笔记(2)---Action中訪问ServletAPI获取Map类型的Servlet元素

    源码: strust.xml <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts ...

  10. 廖雪锋笔记1---python变量类型

    整型:a/b a//b a%b 浮点型:.2 字符串: "" '' r"" r'' '''...''' r'''...'''' 变量值共享:写时复制 NULL型 ...