Question: If i have a node list type string, how do i put the data from each node into a string array and print the results?

If i have a node list type string, how do i put the data from each node into a string array and print the results? I am creating the node list myself so i just need generic code how to print the data from each node into a String array.
1670 * 168 * Returns an array of the words in the list, in the order that the client * would expect. * * 169 170 171 172 * * @return an array of all the words in the list * 1730 174 public String[] toArray() { return null; private class Node { private String data; private Node next; 175 176 1770 178 179 180 181 1820 183 184 185 186 187 // Constructs a new node with the specified data private Node(String data) { this.data = data; this.next = null; } * /** * Returns an array of the words in the list, in the order that the client * would expect. * * * * @return an array of all the words in the list * public String[] toArray() { return null
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
