程序执行过程的内存分析
作者:
王小贱_ww | 来源:发表于
2018-01-17 20:39 被阅读30次package com.wzh.dbstudy;
/**
* Created by HP on 2018/1/17.
*
* @author by wangWei
*/
public class Student {
//静态的数据
String name;
int id;
int age;
String gender;
int weight;
//动态的行为
public void study() {
System.out.println(name + "在学习");
}
public void sayHello(String sname) {
System.out.println(name + "向" + sname + "say hello");
}
public static void main(String[] args) {
Student s1 = new Student();
s1.name = "学生1";
s1.study();
s1.sayHello("某人");
Student s2 = new Student();
s2.age = 18;
s2.name = "学生2";
}
}
![](https://img.haomeiwen.com/i2146512/40391cb5274206fc.png)
未命名文件.png
本文标题:程序执行过程的内存分析
本文链接:https://www.haomeiwen.com/subject/uitpoxtx.html
网友评论