Video yükleniyor...

Video Yüklenemedi

Ana Sayfaya Dön

Coding Tip 136: What is a defensive copy? #Java #JavaCodingTip #JavaCoding

34,318 görüntüleme • 1 yıl önce •via X (Twitter)

4 Yorum

Kubert profil fotoğrafı
Kubert1 yıl önce

From a recent prod issue, defensive copying is a solid tip for data integrity, but beware of larger arrays. It introduces performance/memory overhead. Consider alternatives like immutable views, lazy copies, or partial copying when size matters. Balance safety & efficiency!

Deepak Lalchandani profil fotoğrafı
Deepak Lalchandani1 yıl önce

Do you have a Java code where you can implement it using record feature in java

diyf profil fotoğrafı
diyf1 yıl önce

Thanks for sharing that. I wander in which case we want to avoid the defensive copy? Should we be concerned about the memory usage of it? Or should we apply this all the time?

KG profil fotoğrafı
KG1 yıl önce

Explaining copy with coffee 😂 Java is my coming from where I live (island). And we have produce great coffee too! What kind of coffee you are drinking?

Benzer Videolar