
class Person{
int age; String name; void Person1(String g,int a){ name=g; age=a; } Person(String s,int i){ name=s; age=i; } void talk(){ System.out.println("my name is:"+name); System.out.println("my age is:"+age);
} } class Hash{ public static void main(String ar[]){ Person obj1=new Person("rama",23); System.out.println("hash code is:"+obj1.hashCode());
Person obj2 = new Person("sita",20); System.out.println("hash code is:"+obj2.hashCode()); obj1.talk(); obj2.talk(); } } in this prog, there is class name as person1, but its compiled and run successfully, please tell me the reason
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.