![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Head-First
amning66
这个作者很懒,什么都没留下…
展开
-
使用 引用 示例
public class Dog {String name;public void bark(){ System.out.println(name+"ruff");} public static void main(String [] args){ /* * 创建一个d1的dog */ Dog d1=new Dog(); d1.bark();转载 2017-01-05 15:25:03 · 297 阅读 · 0 评论 -
Head First java 猜数字游戏
public class GuessGame { Player p1; Player p2; Player p3; public void startGame(){ p1= new Player(); p2 = new Player(); p3 = new Player(); /* * 声明转载 2017-01-05 11:14:51 · 784 阅读 · 1 评论 -
Sink a DotCom
DotCom 类: 用来保存DotCom的名字 是否命中的判定方法import java.util.ArrayList;public class DotCom { /* * 动态数组建立 用来保存DotCom的名字 */ private ArrayList<String> locationCells; public void setlocationCel转载 2017-01-06 14:50:40 · 724 阅读 · 1 评论 -
多态的使用----自行编写维护list以保存对象
public class duotai { public static void main(String [] args) { Cat c = new Cat(); Dog d = new Dog(); MyAnimalList List = new MyAnimalList (); List.add(c);转载 2017-01-09 22:21:02 · 326 阅读 · 0 评论