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.的更多相关文章

  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. Milk Patterns

    poj3261:http://poj.org/problem?id=3261 题意:给定一个字符串,求至少出现k 次的最长重复子串,这k 个子串可以重叠. 题解:还是用后缀数组,求H和后缀数组,然后二 ...

  2. SQL Server 2008 数据库误删除数据的恢复

    原文:SQL Server 2008 数据库误删除数据的恢复 原文:http://www.cnblogs.com/dudu/archive/2011/10/15/sql_server_recover_ ...

  3. Linux Shell编程(27)——子shell

    运行一个shell脚本时会启动另一个命令解释器. 就好像你的命令是在命令行提示下被解释的一样, 类似于批处理文件里的一系列命令.每个shell脚本有效地运行在父shell(parent shell)的 ...

  4. HDOJ/HDU 2561 第二小整数(水题~排序~)

    Problem Description 求n个整数中倒数第二小的数. 每一个整数都独立看成一个数,比如,有三个数分别是1,1,3,那么,第二小的数就是1. Input 输入包含多组测试数据. 输入的第 ...

  5. 使用Jquery解析Json基础知识(转)

    在WEB数据传输过程中,json是以文本,即字符串的轻量级形式传递的,而客户端一般用JS操作的是接收到的JSON对象,所以,JSON对象和JSON字符串之间的相互转换.JSON数据的解析是关键. 先明 ...

  6. Alfred(未完待续)

    之前曾经有写过一篇QuickSilver的博文,大力称赞它是Mac下的神器,但是现在,QS光荣下岗了,因为我找到了另外一款比QS更加好用,更加神器的APP:Alfred小帽子. 软件名:Alfred ...

  7. JavaScript高级程序设计8.pdf

    基本包装类型 为了便于操作基本类型值,ECMAScript定义了3个特殊的引用类型Boolean,Number和String.这些类型与本章介绍的其他用类型相似,同时也具备与各自的基本类型相应的特殊行 ...

  8. Java内部类的一些总结

    作为刚入门Java的小白,这两天看到内部类,这里做一个总结,若有错误,欢迎指正~ 内部类是指在一个外部类的内部再定义一个类.类名不需要和文件夹相同. 内部类分为: 成员内部类.局部内部类.静态嵌套类. ...

  9. 从Java视角理解CPU上下文切换(Context Switch)

    从Java视角理解系统结构连载, 关注我的微博(链接)了解最新动态   在高性能编程时,经常接触到多线程. 起初我们的理解是, 多个线程并行地执行总比单个线程要快, 就像多个人一起干活总比一个人干要快 ...

  10. 关于android 自己实现 back键 home键

    今天在被问到一个问题的时候突然想要看看这些东西了.因为一直以来,我返回上个界面,和大家普遍的方法都是一样的. 1. finish()本页面. 2. intent 跳转到上个页面. 一 ,在 按下手机上 ...