This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubts on core java concepts

 
Padma priya Gururajan
Ranch Hand
Posts: 437
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

1) Can you tell the difference between mutable and i mmutable class?
2) When you we go for abtract classes?


Thanks
 
Sagar Rohankar
Ranch Hand
Posts: 2906
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. You can not change internal state of immutable object, where as its possible to modify object if its mutable one.

2. If you found a set of objects sharing some common behavior and you want to encapsulate this common logic to one place, you can create a base _abstract_ class and let those classes to extend it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic