Java Tutorial for Beginners - Learn Java - #34 - Creating an Immutable Class
In this video I'm going to be showing you how to make an immutable class. Immutable classes in Java are pretty straight forward, all you have to do to make an immutable class in Java is basically make everything private in the class that you want to be immutable, and of course make the class final and then you have a Java immutable class. TLDW: Make everything private, and make the class final. Did you find this video helpful? If so, why not subscribe!? ► http://bit.ly/CognitiveSurge Follow me on Twitter (Feel free to tweet me questions!) https://twitter.com/karlhadwen
In this video I'm going to be showing you how to make an immutable class. Immutable classes in Java are pretty straight forward, all you have to do to make an immutable class in Java is basically make everything private in the class that you want to be immutable, and of course make the class final and then you have a Java immutable class. TLDW: Make everything private, and make the class final. Did you find this video helpful? If so, why not subscribe!? ► http://bit.ly/CognitiveSurge Follow me on Twitter (Feel free to tweet me questions!) https://twitter.com/karlhadwen