NYP Arayüz ve Paketler
This file contains 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
package UzakService; | |
public interface IListelenebilir { | |
String stringAl(); | |
} |
This file contains 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
package net.emirozturk; | |
import UzakService.IListelenebilir; | |
import UzakService.Manager; | |
import UzakService.Musteri; | |
import UzakService.Urun; | |
import java.util.ArrayList; | |
public class Main { | |
public static void listele(ArrayList<IListelenebilir> liste){ | |
for(var l:liste) | |
System.out.println(l.stringAl()); | |
} | |
public static void main(String[] args) { | |
var musteriListesi = Manager.MusteriListesiAl(); | |
var urunListesi = Manager.UrunListesiAl(); | |
listele(musteriListesi); | |
listele(urunListesi); | |
} | |
} |
This file contains 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
package UzakService; | |
import java.util.ArrayList; | |
public class Manager { | |
public static ArrayList<IListelenebilir> MusteriListesiAl(){ | |
var musteriListesi = new ArrayList<IListelenebilir>(); | |
musteriListesi.add(new Musteri("123","Emir","Öztürk")); | |
musteriListesi.add(new Musteri("456","Ahmet","Durmuş")); | |
musteriListesi.add(new Musteri("789","Esat","Tufan")); | |
return musteriListesi; | |
} | |
public static ArrayList<IListelenebilir> UrunListesiAl(){ | |
var urunListesi = new ArrayList<IListelenebilir>(); | |
urunListesi.add(new Urun("U1","Ürün 1")); | |
urunListesi.add(new Urun("U2","Ürün 2")); | |
urunListesi.add(new Urun("U3","Ürün 3")); | |
return urunListesi; | |
} | |
} |
This file contains 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
package UzakService; | |
public class Musteri implements IListelenebilir { | |
private String TCKN; | |
private String ad; | |
private String soyad; | |
Musteri(String TCKN,String Ad,String Soyad){ | |
this.TCKN = TCKN; | |
ad = Ad; | |
soyad = Soyad; | |
} | |
public String stringAl() { | |
return "TCKN: "+TCKN+" Ad-Soyad: "+ad+" "+soyad; | |
} | |
} |
This file contains 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
package UzakService; | |
public class Urun implements IListelenebilir{ | |
private String urunKodu; | |
private String urunAdi; | |
Urun(String UrunKodu,String UrunAdi){ | |
urunKodu = UrunKodu; | |
urunAdi = UrunAdi; | |
} | |
public String stringAl() { | |
return "Ürün Kodu: "+urunKodu + " Ürün Adı: "+urunAdi; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment