Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        System.out.println("Enter a string");
        Scanner input = new Scanner(System.in);
        String s1 = input.nextLine();
        s1 = s1.trim();
        int howLong = s1.length();

        for (int counter = 0; counter < howLong; counter++) {
            char ch = s1.charAt(counter);
            System.out.print(ch);
        }

    }
}