Scala Case class is immutable. If we use it as POJO of Java, then we will not be able to set the variable again because it is immutable. How can it be used a a POJO of Java in such a case where setting is not possible?
Well, case classes can be defined quickly and concisely, with ready-made implementations of equals(), hashCode(), and toString(), and they can be used in pattern matching. Those are all nice benefits.
Also, nothing actually prevents you from putting mutable fields in a case class. Scala likes to encourage and facilitate using immutable instances whenever possible, but if you need mutability, you can get it.