How to read characters in a string in java -
I'm new to Java, so I'm sorry that this is a clear question.
I am trying to read a string character with the character to create tree nodes. For example, input I have seen that Can I use a circle to get all the characters? As n node = reader.ext () I tried but it does not work. Scanner Reader = New Scanner (System.in); How can I do that? System.out.println ("input your nodes as capital letters without space and end in '/' '); int i = 0; char node = reader.nxt (). Charite (I); While (node! = '/') { You can only "HJIOADH" and nodes
HJIOADH
char node = reader .next () charAt (0). I have four nodes = reader.next () I can get the first four hours by CharAt (1); Can I do this with the other Chart J?
. Charite (i)
CreateNode (node); // This is a function to create a tree node i ++; node = reader NXT (). Charite (I);}
next ( ) Once your reader, unless it is repeated repeatedly in it.
string nodes = reader.a (Int i = 0; i & lt; nodes. Length (); i ++) {System.out.println (nodes. ((I));}
Comments
Post a Comment