MCPcopy Create free account
hub / github.com/SFUMECJF/cs61b-study-guide / Puppy

Class Puppy

HelloWorld.java:8–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6 }
7
8public class Puppy{
9 public Puppy(){
10 name = "大黄";
11 }
12
13 public Puppy(String name){
14 // 这个构造器仅有一个参数:name
15 this.name = name;
16 }
17 public Puppy(String name, int age){
18 // 这个构造器仅有一个参数:name
19 this.name = name;
20 }
21}
22
23da_huang = Puppy();
24da_huang = Puppy("大红");

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected