I've been reading Head First Object-Oriented Analysis and Design book and I'm trying to learn oop.
in one of the pages of this book, I've read these lines:
we’ve made the application less fragile along the way. It’s not going to break so easily now, because we’ve added both type safety and value safety with these enums.
and also:
So you can’t misspell or mistype an enum without getting a compiler error. It’s a great way to get not only type safety, but value safety; you can a void getting bad data for anything that has a standard range or set of legal values.
I've read this answer and I got confused because I thing the answer is something that we can assume that as value-safety.
now my question is What is the difference between type-safety and value-safety? and how can Enum bring us type-safety and value-safety? please give me some example about type-safety scenario and value-safety scenario in enums.
Thanks. sorry for my bad English.