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
| // Nama : USMAN YAKIN TRIO SINADA | |
| // Nim : 251410006 | |
| // Kelas : Si2A | |
| class Product { | |
| String nama; // Nama produk (contoh: Laptop) | |
| // Constructor | |
| Product(this.nama); | |
| } |
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
| // Nama : USMAN YAKIN TRIO SINADA | |
| // Nim : 251410006 | |
| // Kelas : Si2A | |
| class Person { | |
| String _name; // Atribut private (diawali underscore) | |
| int age; // Atribut publik | |
| // Constructor | |
| Person(this._name, this.age); |
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
| // Nama : USMAN YAKIN TRIO SINADA | |
| // Nim : 251410006 | |
| // Kelas : Si2A | |
| class Mahasiswa { | |
| String nama; // nama : USMAN YAKIN TRIO SINADA | |
| String nim; // nim : 251410006 | |
| double ipk; // ipk : 3.90 | |
| // Constructor Mahasiswa (Menginisialisasi data input) | |
| Mahasiswa(this.nama, this.nim, this.ipk); |
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
| // Nama : USMAN YAKIN TRIO SINADA | |
| // Nim : 251410006 | |
| // Kelas : Si2A | |
| class Car { | |
| String model; // Properti model | |
| String color; // Properti warna | |
| // Constructor untuk inisialisasi model dan color secara langsung | |
| Car(this.model, this.color); |
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
| // Nama : USMAN YAKIN TRIO SINADA | |
| // Nim : 251410006 | |
| // Kelas : Si2A | |
| class Car { | |
| String model; // Properti model | |
| String color; // Properti warna | |
| // Constructor untuk inisialisasi model dan color secara langsung | |
| Car(this.model, this.color); |
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
| // Nama : USMAN YAKIN TRIO SINADA | |
| // Nim : 251410006 | |
| // Kelas : Si2A | |
| class Product { | |
| String nama; // Nama produk (contoh: Handphone) | |
| // Constructor | |
| Product(this.nama); | |
| } |
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
| lass Person { | |
| String _name; // Atribut private (diawali underscore) | |
| int age; // Atribut publik | |
| // Constructor | |
| Person(this._name, this.age); | |
| // Setter untuk mengubah nilai _name secara aman | |
| void setName(String name) => _name = name; |
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
| String nama; // nama : USMAN YAKIN TRIO SINADA | |
| String nim; // nim : 251410006 | |
| double ipk; // ipk : 3.90 | |
| // Constructor Mahasiswa (Menginisialisasi data input) | |
| Mahasiswa(this.nama, this.nim, this.ipk); | |
| // Method untuk menampilkan data mahasiswa ke konsol | |
| void tampilkanData() { | |
| print('Nama : $nama'); |
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
| String nama; // nama : USMAN YAKIN TRIO SINADA | |
| String nim; // nim : 251410006 | |
| double ipk; // ipk : 3.90 | |
| class Car { | |
| String model; // Properti model | |
| String color; // Properti warna | |
| // Constructor untuk inisialisasi model dan color secara langsung | |
| Car(this.model, this.color); |
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
| String nama; // nama : USMAN YAKIN TRIO SINADA | |
| String nim; // nim : 251410006 | |
| double ipk; // ipk : 3.90 | |
| class Car { | |
| String model; // Properti model | |
| String color; // Properti warna | |
| // Constructor untuk inisialisasi model dan color secara langsung | |
| Car(this.model, this.color); |
NewerOlder