my dog learned polymorphism
The moose likes Beginning Java and the fly likes Doubts on core java concepts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Doubts on core java concepts" Watch "Doubts on core java concepts" New topic

Doubts on core java concepts

Padma priya Gururajan
Ranch Hand

Joined: Oct 05, 2006
Posts: 437

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


Padma priya N.G.
Be the change you want to be - Mahatma Gandhi
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2904

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.

[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
I agree. Here's the link:
subject: Doubts on core java concepts
jQuery in Action, 3rd edition