• java基础之【堆、栈、方法区】结构图


    |--数组实例化过程

    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    |--Person实例化过程


    package com.domain;
    class Person {
    	public String name;
    	public String gender;
    	public int age;
    	public void meals() {
    		System.out.println("吃饭.....");
    	}
    	public void shudy() {
    		System.out.println("学习....");
    	}
    	public void slepp() {
    		System.out.println("睡觉..");
    	}
    }
    public class PersonMain {
    	public static void main(String[] args) {
    		Person p1 = new Person();
    		p1.meals();
    		
    		Person p2 = new Person();
    		p2.shudy();
    		
    		Person p3 = p2;
    		p3.slepp();
    		System.out.println("--------------");
    		p1.name = "郑源";
    		p2.name = "周杰伦";
    		p3.name = "周董";
    		System.out.println(p1.name);
    		System.out.println(p2.name);
    		System.out.println(p3.name);
    	}
    }
    


  • 相关阅读:
    python之路-javascript
    python之路-css
    python之路-初识前端
    python之路-线程
    python之路-socket
    base64 convert to file
    base64 json
    centos7 hostname
    geoip2 domain
    佛教六度
  • 原文地址:https://www.cnblogs.com/blfbuaa/p/6760443.html
Copyright © 2020-2023  润新知