Constant Objects in Java
1 posts in topic
Flat View  Flat View

Posted By:   sanjay_srivatsa
Posted On:   Friday, August 13, 2004 06:29 AM

In java we can declare final classes, final variables and final methods. Like in C++, does Java allow to create constant objects, so that its attributes cannot be modified ? If it allows, how can it be done ?

Re: Constant Objects in Java

Posted By:   Anonymous  
Posted On:   Wednesday, August 25, 2004 07:18 AM

try to do this

let we consider car is a class

final car c = new car();
About | Sitemap | Contact