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

        StringBuffer strbuf = new StringBuffer(str1);
        System.out.println("Method returns : " + str2.contentEquals(strbuf));

        str2 = str1.toUpperCase();
        System.out.println("Method returns : " + str2.contentEquals(strbuf));
    }
}