Search your topic here

String program 5

public class hash {

            /**
             * @param args, class name cant be Hash, because ists predefined name of class
             */
            public static void main(String[] args) {
                        // TODO Auto-generated method stub
                        String s1 = "hello";
                        String s2 = "Hello";
                        System.out.println("Tha hash code for"+s1+ "is" +s1.hashCode());
                        System.out.println("The hash code for"+s2+ "is" +s2.hashCode());
                       
            }


}

LEAVE A REPLY