创建对象内存分析
package com.oop.demo03; public class Pet { public String name; public int age; public void shout(){ System.out.println("叫了一声"); } } /* public static void main(String[] args) { Pet dog = new Pet(); dog.name="旺财"; dog.age=3; dog.shout(); System.out.println(dog.name); System.out.println(dog.age); } */
标签:System,Pet,Day7,dog,创建对象,内存,public,out From: https://www.cnblogs.com/actadams68/p/16899363.html