Win a copy of Mesos in Action this week in the Cloud/Virtualizaton 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: 2907
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