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 str1 = "java2s.com";

        String str2 = str1.intern();

        System.out.println(str2);

        System.out.println("Is str1 equal to str2 ? = " + (str1 == str2));
    }
}