Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.util.Arrays;

public class Main {
    public static void main(String[] args) {
        String str = "Result";
        String str1 = "rEsLtu";

        char[] firstString = str.toLowerCase().toCharArray();
        char[] secondString = str1.toLowerCase().toCharArray();

        Arrays.sort(firstString);
        Arrays.sort(secondString);

        if (Arrays.equals(firstString, secondString) == true) {
            System.out.println("same");
        } else {
            System.out.println("different");
        }
    }
}