How to print the reverse of the String java is object orientated language without using any predefined function like reverse()?
import java.util.*;
public class Restring {
public static void main(String[] args) {
String input,output;
Scanner kbd=new Scanner(System.in);
System.out.println("Please Enter a String");
input=kbd.nextLine();
int n=input.length();
char tmp[]=new char[n];
char nxt[]=new char[n];
tmp=input.toCharArray();
int m=0;
for(int i=n-1;i>=0;i--)
{
nxt[m]=tmp[i];
m++;
}
System.out.print("Reversed String is ");
for(int i=0;i