Defensive Copying
Everything on SkillVeris tagged Defensive Copying — collected across the glossary, study notes, blog, and cheat sheets.
4 resources across 1 library
Interview Questions(4)
What is Immutability in OOP?
Immutability means an object’s observable state cannot change after it is constructed — every field is fixed for the lifetime of the object, so any operation t…
What is an Accessor Method in OOP?
An accessor method, commonly called a getter, is a public method that returns the value of a private field without modifying the object’s internal state, provi…
Getters and Setters: Best Practices
Good getter/setter practice means not generating them blindly for every field, but instead validating input in setters, returning defensive copies of mutable f…
What is an Encapsulation Violation?
An encapsulation violation occurs when code outside a class can read or modify that class's internal state directly or indirectly, bypassing the validated publ…