KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Why there are different hashCode values for each time you run a java main? Look the example code below. interface testInt{ public int getValue(); } enum test implements testInt{ A( 1 ), B( 2 ); private int value; private test( int value ) { this.value = value; } public int getValue() { return this.value; } } For each time you run, public static void main( String[] args ) { System.out.println( test.A.hashCode() ); } there will be different printed values on the console. Why that inconsistency?
Tags (comma-separated)
Save Edits
Cancel