MainClass.java Source code

Java tutorial

Introduction

Here is the source code for MainClass.java

Source

class MainClass {
    public static void main(String[] args) {
        String s1 = "abc";
        String s2 = "abc";
        String s3 = "def";

        System.out.println("s1 hash code = " + s1.hashCode());
        System.out.println("s2 hash code = " + s2.hashCode());
        System.out.println("s3 hash code = " + s3.hashCode());
    }
}