View Arayuzler.java
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 interfaces; | |
public class Arayuzler { | |
public static void main(String[] args) { | |
Kopekler kopek = new Kopekler(); | |
kopek.yemekYe(); | |
} |
View Arayuzler.java
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 interfaces; | |
public class Arayuzler { | |
public static void main(String[] args) { | |
Kopekler kopek = new Kopekler(); | |
Koyunlar koyun = new Koyunlar(); | |
kopek.yemekYe(); |
View SoyutSinif.java
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 abstractclass; | |
public class SoyutSinif { | |
public static void main(String[] args) { | |
Baliklar balik = new Baliklar(); | |
Kuslar kus = new Kuslar(); | |
balik.yemekYe(); |
View SoyutSinif.java
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 abstractclass; | |
public class SoyutSinif { | |
public static void main(String[] args) { | |
// Hayvanlar hayvanlar = new Hayvanlar(); | |
// Bu kesinlikle hata verecektir | |
// Soyut sınıftan nesne oluşturulamaz | |
View CokBicimlilik.java
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 polymorphism; | |
public class CokBicimlilik { | |
public static void main(String[] args) { | |
Hayvan hayvan = new Hayvan(); | |
Hayvan kedi = new Kedi(); | |
Hayvan kopek = new Kopek(); | |
View CokBicimlilik.java
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 polymorphism; | |
public class CokBicimlilik { | |
public static void main(String[] args) { | |
Hayvan hayvan = new Hayvan(); | |
Hayvan kedi = new Kedi(); | |
Hayvan kopek = new Kopek(); | |
View Kalitim.java
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 inheritance; | |
public class Kalitim { | |
public static void main(String[] args) { | |
// Her iki sınıftanda nesne oluşturduk | |
Arac arac = new Arac(); | |
Kamyon kamyon = new Kamyon(); | |
View Kalitim.java
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 inheritance; | |
public class Kalitim { | |
public static void main(String[] args) { | |
// Her iki sınıftanda nesne oluşturduk | |
Arac arac = new Arac(); | |
Kamyon kamyon = new Kamyon(); | |
View Kalitim.java
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
class Arac{ | |
} | |
// Önce ana sınıfın adı girilir | |
// Daha sonra extends kelimesi | |
// Son olarak miras alınacak sınıf girilir | |
class Kamyon extends Arac{ |
View Kapsulleme.java
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 encapsulation; | |
public class Kapsulleme { | |
public static void main(String[] args) { | |
Araba araba = new Araba(); | |
araba.setRenk("Mavi"); | |
araba.setRenk("Siyah"); |
NewerOlder