0
   

If the class is immutable, when does it change the values of its attributes?

 
 
Reply Tue 6 Mar, 2012 12:21 pm
If the class is immutable, when does it change the values of its attributes? Does it only change the attributes, when it calls the constructor of the class with attributes as its parameters?
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Question • Score: 0 • Views: 1,010 • Replies: 3
No top replies

 
Fido
 
  -1  
Reply Tue 6 Mar, 2012 08:01 pm
@alvoutila,
alvoutila wrote:

If the class is immutable, when does it change the values of its attributes? Does it only change the attributes, when it calls the constructor of the class with attributes as its parameters?

I think the only quality a class might change and still be immutable is percentage relative to other classes, or number... Mutation is change...
maxdancona
 
  1  
Reply Tue 6 Mar, 2012 10:12 pm
@Fido,
Fido, I don't think you understand the question. This is a question about technology-- specifically object-oriented programming. I don't know if your answer makes sense in any field... but it certainly doesn't make sense here.
0 Replies
 
maxdancona
 
  1  
Reply Tue 6 Mar, 2012 10:13 pm
@alvoutila,
Yes, in an immutable class the members are set when the instance is constructed, or the class is loaded. They are not modified at any other time.
0 Replies
 
 

Related Topics

 
  1. Forums
  2. » If the class is immutable, when does it change the values of its attributes?
Copyright © 2024 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.04 seconds on 05/01/2024 at 10:36:08