You are viewing a single comment's thread from:

RE: How to reverse String using java - learn java

in #programming7 years ago

You can do it without the character array:

class Reversestring
{
  public static void main(String args[])
  {
    String s="ravikumar";
    for(int i=s.length()-1;i>=0;i--)
    {
      System.out.print(s.charAt(i));
    }
  }
}
Sort:  

Would be nice to see it as OOP based class static and not static :)

Coin Marketplace

STEEM 0.20
TRX 0.13
JST 0.030
BTC 64573.45
ETH 3441.06
USDT 1.00
SBD 2.51