Skip to content

Commit d28831e

Browse files
authored
Add toString override and remove setValue
1 parent 4cb871f commit d28831e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

DataStructures/Graph/src/graph/Node.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ public Node(String value)
1212
{
1313
this.value = value;
1414
}
15+
16+
public String getValue() { return this.value; }
1517

16-
public void setValue(String value) { this.value = value; }
17-
public String getValue() { return value; }
18+
@Override
19+
public String toString() { return this.value; }
1820
}

0 commit comments

Comments
 (0)