Solution Review: Manage the Sign Boards
Have a look at the solution to the 'Manage the Sign Boards' challenge.
We'll cover the following...
We'll cover the following...
The TrafficSign class
Rubric criteria
First, look at the TrafficSign class.
public class TrafficSign{// private instancesprivate String name;private String code;// constructorpublic TrafficSign(String name, String code){this.name = name;this.code = code;}public void Description(){System.out.println("Sign's description");}}
Rubric-wise explanation
Point 1:
We add the header of TrafficSign at line 1.
Point 2:
Initially, we create private instances: name and code. Each sign has a name and a code associated with it. Next, at line 8, we design its constructor.
Point 3:
Look at line 14. We create the header of the Description() ...