KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Why won't declaring an array final make it immutable in Java? Doesn't declaring something final mean it can't be changed? From question related to immutable array it's clear that declaring an array final doesn't make it unchangeable. The following is possible. final int[] array = new int[] {0, 1, 2, 3}; array[0] = 42; My question is: What is the function of declaring final here then?
Tags (comma-separated)
Save Edits
Cancel