Question: how do i get my toString method to print in this format: public String toString ( ) { return Node + name +

how do i get my toString method to print in this format: public String toString(){
return "Node "+ name +" has indegree "+getIncomingEdges().size()+", has an outDegree of: "+getOutgoingEdges().size()+"
";
} Format: Indegree:
Node C has indegree 4
Node A has indegree 3
Node B has indegree 2
Node D has indegree 2
Node E has indegree 2
Outdegree:
Node A has outdegree 3
Node B has outdegree 3
Node D has outdegree 3
Node E has outdegree 3
Node C has outdegree 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!