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 str = "A,B,C,D";

        // Split str using a comma as the delimiter
        String[] parts = str.split(",");

        // Print the the string and its parts
        System.out.println(str);

        for (String part : parts) {
            System.out.println(part);
        }
    }
}