Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

public class Main {
    public static void main(String[] args) {

        String original = "java2s.com";
        String[] words = original.split("\\s+");
        System.out.print("Reversed String in Place:" + " ");
        for (int i = words.length - 1; i >= 0; i--) {
            System.out.print(words[i] + " ");
        }
    }
}