/setterproperty.dart Secret
Created
July 16, 2022 00:13
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
///File ini adalah contoh pendefinisian property setter di bahasa pemrograman Dart | |
///properti geekasmedia.blogspot.com | |
abstract class Kendaraan { | |
//enkapsulasi | |
String? _jenis; | |
//properti setter | |
set type(String? tipe) { | |
_jenis = tipe; | |
} | |
//method getter dengan arrow notation | |
String? get tipe => _jenis; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment