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
private String ad; | |
private String soyad; | |
private int numara; | |
} |
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
public static void main(String[] args) { | |
Araba araba1 = new Araba(); | |
araba1.renk="siyah"; | |
araba1.marka="Volkswagen"; | |
araba1.model=2019; | |
System.out.println("ARABA BİLGİLERİ: Arabanın markası "+ araba1.marka + " modeli " + araba1.model + " rengi "+ araba1.renk); | |
Araba araba2 = new Araba(); | |
araba2.renk="mavi"; | |
araba2.marka="Jaguar"; |
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
//Araba Class | |
public String renk; | |
public String marka; | |
public int model; | |
} |
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
public class MainClass { | |
public static void main(String[] args) { | |
Ogrenci ogrenci1 = new Ogrenci(); //Nesne oluşturduk | |
} | |
} |
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
public String ad; | |
public String soyad; | |
public int numara; | |
public Ogrenci() { //Default Yapılandırıcı | |
} | |
} |
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
public String ad; | |
public String soyad; | |
public int numara; | |
public Ogrenci() { //Müdahale edilmiş yapılandırıcı | |
System.out.println("Ögrenci Nesnesi Oluşturuldu") | |
} | |
} |
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
public class Ogrenci { | |
public String adSoyad; | |
public String sehir; | |
public int numara; | |
public int sinif; | |
} |
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
public class MainClass { | |
public static void main(String[] args) { | |
Ogrenci ogrenci1 = new Ogrenci(); | |
ogrenci1.adSoyad="Furkan Bodur"; | |
ogrenci1.sehir="Ankara"; | |
ogrenci1.numara=2179398; | |
ogrenci1.sinif=1; | |
} | |
} |
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
public class Ogrenci { | |
private String adSoyad; | |
private String sehir; | |
private int numara; | |
private int sinif; | |
public void setAdSoyad(String adSoyad) { | |
this.adSoyad=adSoyad; | |
} | |
public void setSehir(String sehir) { |
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
public static void main(String[] args) { | |
Ogrenci ogrenci1 = new Ogrenci(); | |
ogrenci1.setAdSoyad("Furkan Bodur"); | |
ogrenci1.setSehir("Ankara"); | |
ogrenci1.setNumara(2179399); | |
ogrenci1.setSinif(1); | |
} | |
} |