├── src ├── java8 │ └── NewFeatures.java ├── concurrency │ └── ConcurrentTasks.java ├── accessmodifiers │ ├── ErisimTest.java │ └── Test.java ├── abstractclass │ └── and │ │ └── interfaces │ │ ├── OutsideErisim.java │ │ └── TestClass.java └── polymorphism │ └── Test.java └── README.md /src/java8/NewFeatures.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdilruba/YouTube-AdvancedJava/HEAD/src/java8/NewFeatures.java -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # YouTube-AdvancedJava 2 | 3 | Youtube ileri seviye Java derslerindeki kodlara bu repodan erişebilirsiniz. 4 | -------------------------------------------------------------------------------- /src/concurrency/ConcurrentTasks.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdilruba/YouTube-AdvancedJava/HEAD/src/concurrency/ConcurrentTasks.java -------------------------------------------------------------------------------- /src/accessmodifiers/ErisimTest.java: -------------------------------------------------------------------------------- 1 | package accessmodifiers; 2 | 3 | public class ErisimTest { 4 | 5 | public static void main(String[] args) { 6 | 7 | Test testObjesi = new Test(); 8 | 9 | System.out.println("Erisebildigim degiskenler : " + 10 | testObjesi.duz + " " + testObjesi.herkese + " " + testObjesi.korumali); 11 | 12 | System.out.println("Gizli :" + testObjesi.getGizli()); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/abstractclass/and/interfaces/OutsideErisim.java: -------------------------------------------------------------------------------- 1 | package abstractclass.and.interfaces; 2 | 3 | import accessmodifiers.Test; 4 | 5 | public class OutsideErisim extends Test{ 6 | 7 | public static void main(String[] args) { 8 | 9 | OutsideErisim outsideErisimObjesi = new OutsideErisim(); 10 | 11 | System.out.println("Eristigim degiskenler : " + 12 | outsideErisimObjesi.korumali + outsideErisimObjesi.herkese); 13 | 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/accessmodifiers/Test.java: -------------------------------------------------------------------------------- 1 | package accessmodifiers; 2 | 3 | public class Test { 4 | 5 | public String herkese = "public degisken"; 6 | protected String korumali = "protected degisken"; 7 | String duz = "default degisken"; 8 | private String gizli = "private degisken"; 9 | 10 | 11 | public String getGizli() { 12 | return this.gizli; 13 | } 14 | 15 | public static void main(String[] args) { 16 | 17 | Test testObjesi = new Test(); 18 | 19 | System.out.println("Erisebildigim degiskenler : " + testObjesi.gizli + 20 | testObjesi.duz + " " + testObjesi.herkese + " " + testObjesi.korumali); 21 | 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/polymorphism/Test.java: -------------------------------------------------------------------------------- 1 | package polymorphism; 2 | 3 | public class Test { 4 | 5 | public static void main(String[] args) { 6 | 7 | Dog doggy = new Dog(); 8 | System.out.println(doggy.hareket()); 9 | Snake snake = new Snake(); 10 | System.out.println(snake.hareket()); 11 | } 12 | 13 | public static int toplama(int a, int b) { 14 | return a+b; 15 | } 16 | 17 | public static int toplama(int a, int b, int c) { 18 | return a+b+c; 19 | } 20 | 21 | public static int toplama(String x, int y) { 22 | return 0; 23 | } 24 | } 25 | 26 | class Animal{ 27 | public String hareket() { 28 | return "hareket ederim."; 29 | } 30 | } 31 | 32 | class Dog extends Animal{ 33 | public String hareket() { 34 | return "kosarim."; 35 | } 36 | } 37 | 38 | class Snake extends Animal{ 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/abstractclass/and/interfaces/TestClass.java: -------------------------------------------------------------------------------- 1 | package abstractclass.and.interfaces; 2 | 3 | public class TestClass { 4 | 5 | public static void main(String args[]){ 6 | //Insan obje= new Insan(182,95); 7 | Bina obje = new Bina(); 8 | System.out.println(obje.boyMetre()); 9 | System.out.println(obje.boySantimetre()); 10 | System.out.println(obje.boyKilometre()); 11 | } 12 | } 13 | 14 | interface Boy{ 15 | int degisken = 0; 16 | static String tanim() { 17 | return "Bu interface implement eden class icin " 18 | + "boy bilgileri donulmesini garanti eder."; 19 | } 20 | int boySantimetre(); 21 | double boyMetre(); 22 | default double boyKilometre() { 23 | return 0; 24 | } 25 | } 26 | 27 | 28 | abstract class Hayvan implements Boy{ 29 | private int boy; 30 | private int kilo; 31 | public abstract boolean canliMi(); 32 | 33 | 34 | public int boySantimetre() { 35 | return this.getBoy(); 36 | } 37 | 38 | public int getBoy() { 39 | return boy; 40 | } 41 | public void setBoy(int boy) { 42 | this.boy = boy; 43 | } 44 | 45 | public int getKilo() { 46 | return kilo; 47 | } 48 | 49 | public void setKilo(int kilo) { 50 | this.kilo = kilo; 51 | } 52 | } 53 | 54 | class Insan extends Hayvan{ 55 | 56 | public Insan(int boy, int kilo) { 57 | this.setBoy(boy); 58 | this.setKilo(kilo); 59 | } 60 | 61 | public boolean canliMi(){ 62 | return true; 63 | } 64 | 65 | 66 | public double boyMetre() { 67 | return this.getBoy()/100.0; 68 | } 69 | } 70 | 71 | class Bina implements Boy{ 72 | 73 | public int boySantimetre() { 74 | return 2000; 75 | } 76 | public double boyMetre() { 77 | return 20; 78 | } 79 | public double boyKilometre() { 80 | return 0.02; 81 | } 82 | 83 | } 84 | 85 | --------------------------------------------------------------------------------