Re: String Reverse
Amit Jain <amitatgroups@gmail.com> writes:
How can I reverse a given string without
using String or StringBuffer class method.
The statement
java.lang.System.out.println( "Hello!" );
can be split in a model and a view.
The model (?"Hello!?) is the internal storage of the code
points H-e-l-l-o-!, the View (?println?) displays this as
Hello!
One can as well adopt the point of view that for the string
model it makes no sense to ?reverse? anything, because the
same model can also be viewed as a storage of the reversed
string, because whether to display the stored code points
H-e-l-l-o-! as
Hello!
or as
!olleH
is solely a question of the View, just as the color of the
characters used to display it or the size of the font.
From such a point of view, every string model already /is/
also a model of the reversed string, without the need for
an explicit computation to ?determine? the reverse string.
(Admittedly, this point of view is not helpful in some cases.)