Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

String Reversing With code

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
import java.io.*;
public class preparestr{
String s="Hello world";

public void reversing(){
int i=s.length();
i=i-1;
for(int j=i; j>=0;j--)
{
System.out.println("The reversed string is"+s.charAt(j));
}
}

public static void main(String args[])
{
preparestr ps=new preparestr();
ps.reversing();
}
}
In the reversing fucn. i am pronting s.charAt().
I want to assign that value to my original string.
Please give me soln.
And also note the condition.
Don't use any Temprory variables,StringBuffer,Arrays.
Please
Reagrads
Prasad
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Perhaps you missed the responses the last time you asked. When you post a question, it's a good idea to read the answers. Also any other comments that might have been made about forum policies. If you have further questions on the same topic, post them as a response to the existing conversation, not as a new post - that way we can all see progress being made.
 
    Bookmark Topic Watch Topic
  • New Topic