Created
September 1, 2023 14:16
-
-
Save jgomo3/9107fe8eb86a5d3eabdf80e7cd4433f8 to your computer and use it in GitHub Desktop.
Decouple structure and implementation and delay the coupling to another time.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Length { | |
int getLength(); | |
} | |
class CommentStruct { | |
protected String author; | |
protected String content; | |
} | |
public class Comment extends CommentStruct implements Length{ | |
public int getLength() { | |
return content.length(); | |
} | |
} | |
// https://youtu.be/5QFDQRkbllo?si=3IY7T8DMM6aXbOWO&t=118 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment