Like to know how to reverse a string value (1 word) which is pre-declared in the program. I mean not using user input or scanner.
Like to reverse a word "TRAIN" which is pre-declared in the program.
Have tried the below program but no results and no error also.
//  QUERY PROGRAM NOT RUNNING - NO RESULT, NO ERROR.
//  STRING REVERSE PROGRAM USING ARRAY
package abnpackage;
class Play {
    void REVERSE (){
        String [] INPUT_WORD = {"T","R","A","I","N"};
        int Q;
        for(Q=INPUT_WORD.length-1; Q>=0; Q=Q--);
            System.out.print ("REVERSE VALUE" + INPUT_WORD[Q]);
    }
    public static void main(String[]args){
        Play PL = new Play();
        PL.REVERSE();
    }
}
 
     
     
     
     
    