Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7443593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:21:15+00:00 2026-05-29T11:21:15+00:00

It is obvious that immutability increases the re-usability since it creates new object in

  • 0

It is obvious that immutability increases the re-usability since it creates new object in each state change.Can somebody tells me a practical scenario where we need a immutable class ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T11:21:15+00:00Added an answer on May 29, 2026 at 11:21 am

    Consider java.lang.String. If it weren’t immutable, every time you ever have a string you want to be confident wouldn’t change underneath you, you’d have to create a copy.

    Another example is collections: it’s nice to be able to accept or return a genuinely immutable collection (e.g. from Guava – not just an immutable view on a mutable collection) and have confidence that it won’t be changed.

    Whether those count as “needs” or not, I don’t know – but I wouldn’t want to develop without them.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It's obvious that a parent class's object can hold a reference to a child,
I always wonder why compilers can't figure out simple things that are obvious to
In Scrum, it is obvious that we could produce a demo after each sprint.
I've had a quick google, but can't find anything obvious that answers the question.
It is obvious that in general the read(2) system call can return less bytes
It is obvious that given any large codebase separate compilation of modules can significantly
Look at this example: http://jsfiddle.net/nvcode/BnGyu/2/ Now it is clearly obvious that the browser can
It seems obvious that some people have been able to figure out how to
Are there some standards that you consider to be so obvious that they would
Why doesn't Python allow modules to have a __call__ method? (Beyond the obvious that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.