Is Final really Final?
Java has a keyword final and C++ has a keyword const. They are similar, but don't fall into the trap of thinking they are identical. Declaring a variable final will prevent the value of that variable from being changed after initialization. However, if that variable is a reference to an object, it will not necessarily prevent the various fields in that object from being changed. e.g. This also applies to parameters declared final.final Table finalTable = new Table(7 ); Table otherTable = new Table(7 ); tb = otherTable; // generates a compiler error finalTable.setSize( 10 ); //ok finalTable.color = 6; //ok
FAQ Home
Sponsored links
Build IT Knowledge with Current & Trusted Content
Helps Employees Develop & Hone New Technical Programming Skills. Sign Up & Get Full Access.
Helps Employees Develop & Hone New Technical Programming Skills. Sign Up & Get Full Access.
Check Out IT Certification Preparation Materials
Sign Up With SkillSoft & Get Access to Training Materials for Over 50 Professional Certifications.
Sign Up With SkillSoft & Get Access to Training Materials for Over 50 Professional Certifications.
SFTP components for .NET
Add complete SSH and SFTP support to your .NET framework application
Add complete SSH and SFTP support to your .NET framework application
Virtual File System SDK
Create your own file systems in Windows and .NET applications
Create your own file systems in Windows and .NET applications
PureCM Software Configuration Management
Version control and integrated issue tracking - powerful and easy to use. Get your FREE trial now!
Version control and integrated issue tracking - powerful and easy to use. Get your FREE trial now!
