The memory graph Shared by the method
Phone类
package com.itheima_03;
/*
* 手机类
*/
public class Phone {
String brand;
int price;
String color; public void call(String name) {
System.out.println("给"+name+"打电话");
} public void sendMessage() {
System.out.println("群发短信");
}
}
手机的测试类
package com.itheima_03;
/*
* 手机类的测试类
*/
public class PhoneDemo2 {
public static void main(String[] args) {
Phone p = new Phone();
p.brand = "小米5s";
p.price = 1999;
p.color = "银色";
System.out.println(p.brand+"---"+p.price+"---"+p.color);
p.call("林青霞");
p.sendMessage(); Phone p2 = new Phone();
p2.brand = "IPhone7S";
p2.price = 7999;
p2.color = "土豪金";
System.out.println(p2.brand+"---"+p2.price+"---"+p2.color);
p2.call("张曼玉");
p2.sendMessage();
}
}
内存图:
main方法执行完毕后,002 003的指向也就没有了,等到垃圾回收器空闲的时候,就会来回收再堆内存的这些垃圾了。
The memory graph Shared by the method的更多相关文章
- Xcode8的调试技能Memory Graph 实战解决闭包引用循环问题
Xcode8的调试技能又增加了一个黑科技:Memory Graph.简单的说就是可以在运行时将内存中的对象生成一张图. 那么通过一个实际项目来练习一下吧. 首先我们写了一个自定义UIView:MyVi ...
- [React] Stop Memory Leaks with componentWillUnmount Lifecycle Method in React
In this lesson we'll take a stopwatch component we built in another lesson and identify and fix a me ...
- System and method to prioritize large memory page allocation in virtualized systems
The prioritization of large memory page mapping is a function of the access bits in the L1 page tabl ...
- GPU编程--Shared Memory(4)
GPU的内存按照所属对象大致分为三类:线程独有的.block共享的.全局共享的.细分的话,包含global, local, shared, constant, and texture memoey, ...
- CUDA ---- Shared Memory
CUDA SHARED MEMORY shared memory在之前的博文有些介绍,这部分会专门讲解其内容.在global Memory部分,数据对齐和连续是很重要的话题,当使用L1的时候,对齐问题 ...
- 【并行计算-CUDA开发】CUDA shared memory bank 冲突
CUDA SHARED MEMORY shared memory在之前的博文有些介绍,这部分会专门讲解其内容.在global Memory部分,数据对齐和连续是很重要的话题,当使用L1的时候,对齐问题 ...
- 【DSP开发】shared memory VS mailbox
Hello, Hi everyone, I have a simple question. Could anyone explain to me the difference between Mail ...
- Paper: A Novel Time Series Forecasting Method Based on Fuzzy Visibility Graph
Problem define a fuzzy visibility graph (undirected weighted graph), then give a new similarity meas ...
- 程序间数据共享与传递:EXPORT/IMPORT、SAP/ABAP Memory
声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将 ...
随机推荐
- 【算法笔记】A1063 Set Similarity
1063 Set Similarity (25 分) Given two sets of integers, the similarity of the sets is defined to be ...
- 分享一个电子发票信息提取工具(Python)
电子发票太多,想统计下总额异常困难,网上工具不好用,花了2个小时实现一份,测试过中石油.京东开具的电子发票还行,部分发票名称失败有问题不影响统计,有需要的小伙伴自己拿去改吧. import cmd i ...
- IT人生的价值和意义 感觉真的有了
为了做新闻APP,我居然短短一个月利用业余时间做了: 一个通用新闻采集器. 一个新闻后台审核网站. 一个通用采集器下载网站. 一个新闻微网站. 一个新闻APP, 而且还给新闻微网站和新闻 APP练就 ...
- (转)jieba中文分词的.NET版本:jieba.NET
简介 平时经常用Python写些小程序.在做文本分析相关的事情时免不了进行中文分词,于是就遇到了用Python实现的结巴中文分词.jieba使用起来非常简单,同时分词的结果也令人印象深刻,有兴趣的可以 ...
- Vagrant 创建虚拟机
Vagrant 创建虚拟机 1. 下载相关软件 虚拟机软件:vmware virtualbox Vagrant 软件:vagrant cd /tmpwget http://download.vir ...
- python描述符学习
目录 一.对象属性的访问控制 二.描述符基本理解 三.基本使用 四.使用描述符完成property.classmethod.staticmethod自定义实现 1.property的自定义实现 2.c ...
- JavaScript数据结构-3.List
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- 关于function构造函数特别注意的
function在javascript中是对象,所以function持有构造函数例子:var a = new Function("x","y","re ...
- Struts2 数据驱动
在servlet中获取页面传递过来的数据的方式是:request.getParameter(“username”);这个代码可以获取到页面的username的数据.在action中可以通过属性驱动的方 ...
- session_start()导致history.go(-1)返回时无法保存表单数据的解决方法
问题背景: 在填写完表单提交时,由于某个表单项可能填写的不合法,导致提交失败,返回表单页面.但返回后所有的表单都被清空了,重新填写比较麻烦,度娘解释说,是由于每个页面都调用了session_start ...