
class Person{ string name; int age; 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 Raju=new Person(); System.out.println("Hashcode="+Raju.hashCode()); } } if i compile this prog,
D:\progs>javac Hash.java Hash.java:9: '{' expected class Hash(){ ^ Hash.java:15: '}' expected ^ 2 errors, i got this error....... please tell me the resolution

Hi Friend,
Try this:
class Person{
String name;
int age;
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 Raju=new Person();
System.out.println("Hashcode="+Raju.hashCode());
}
}
Thanks
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.