Question 1 of 10
A library hold slip stores a patron name with this. What text does this Java code display?
class HoldSlip {
private String name;
public HoldSlip(String name) {
this.name = name;
}
public String label() {
return this.name;
}
}
HoldSlip novel = new HoldSlip("Ada");
System.out.print(novel.label());
- A. Ada
- B. null
- C. name
- D. The code does not compile.