memesearch
Kotlin Data Class vs Java Boilerplate

Kotlin Data Class vs Java Boilerplate

Download Find similar pictures
Text on the meme
data class Person(val name: String) private String name; public Person(String name) { this.name = name; } public String getName() { return name; } public void setName(String name) { this.name = name; } // toString... // hashCode... // equals... // copy...
What it means

A comparison shows Kotlin’s concise data class declaration beside the verbose Java code required to define the same Person class with a field, constructor, getters, setters, and generated methods. The joke is that Kotlin eliminates repetitive boilerplate, making Java look unnecessarily cumbersome to programmers.

Objects
Tags
Source
Type
image
Size
800×376 · 20.3 KiB
Mood
sarcastic
Language
en
Added