标签:void inf str nbsp new 创建 rgs thinking pac
package cn.skyfffire; /** * * @author skyffire * */ class Tree { int height; Tree() { prt("无参数构造"); } Tree(int i) { prt("创建Class Tree使用Integer参数" + i); height = i; } Tree(String s) { prt(s); } void info() { prt("Tree 值:" + height); } static void prt(String s) { System.out.println(s); } } public class Test { public static void main(String[] args) { Tree aTree = new Tree("hhh"); Tree bTree = new Tree(1); aTree.info(); bTree.info(); } }
标签:void inf str nbsp new 创建 rgs thinking pac
原文地址:http://www.cnblogs.com/skyfffire/p/6444150.html