You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
publicStringtoString(){ //overriden toString() of Object class
returni+"";
}
publicinthashCode(){ //overriden hashCode() of Object class
returni;
}
publicstaticvoidmain(String[] args){
Testt1=newTest(10);
Testt2=newTest(100);
System.out.println(t1); //Test class overriden toString() method will be called which internally further will invoke Test class overriden hashCode method
System.out.println(t2); // Test class overriden toString() method will be called which internally further will invoke Test class overriden hashCode method