-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1804e53
commit ee612b2
Showing
43 changed files
with
411 additions
and
0 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
3.gün ödev-33-45videolar/abstractClasses/src/GameCalculator.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
public abstract class GameCalculator { | ||
|
||
public abstract void hesapla (); | ||
|
||
public final void gameOver (){ | ||
System.out.println("Oyun bitti"); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
3.gün ödev-33-45videolar/abstractClasses/src/KidsGameCalculator.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
public class KidsGameCalculator extends GameCalculator{ | ||
|
||
@Override | ||
public void hesapla (){ | ||
System.out.println("Puanınız : 100"); | ||
} | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
public class Main { | ||
public static void main(String[] args) | ||
{ | ||
WomanGameCalculator womanGameCalculator = new WomanGameCalculator(); | ||
womanGameCalculator.hesapla(); | ||
womanGameCalculator.gameOver(); | ||
|
||
GameCalculator gameCalculator = new WomanGameCalculator(); | ||
|
||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
3.gün ödev-33-45videolar/abstractClasses/src/ManGameCalculator.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
public class ManGameCalculator extends GameCalculator{ | ||
public void hesapla (){ | ||
System.out.println("Puanınız : 90"); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
3.gün ödev-33-45videolar/abstractClasses/src/OlderGameCalculator.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
public class OlderGameCalculator extends GameCalculator{ | ||
|
||
@Override | ||
public void hesapla (){ | ||
System.out.println("Puanınız : 100"); | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
3.gün ödev-33-45videolar/abstractClasses/src/WomanGameCalculator.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
public class WomanGameCalculator extends GameCalculator{ | ||
public void hesapla (){ | ||
System.out.println("Puanınız : 95"); | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
3.gün ödev-33-45videolar/abstractDemo/src/BaseDatabaseManager.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
public abstract class BaseDatabaseManager { | ||
|
||
abstract void getData(); | ||
} |
9 changes: 9 additions & 0 deletions
9
3.gün ödev-33-45videolar/abstractDemo/src/CustomerManager.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
public class CustomerManager { | ||
|
||
BaseDatabaseManager databaseManager; | ||
|
||
public void getCustomers() | ||
{ | ||
databaseManager.getData(); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
public class Main { | ||
public static void main(String[] args) | ||
{ | ||
CustomerManager customerManager = new CustomerManager(); | ||
customerManager.databaseManager = new MySqlDatabaseManager(); | ||
customerManager.getCustomers(); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
3.gün ödev-33-45videolar/abstractDemo/src/MySqlDatabaseManager.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
public class MySqlDatabaseManager extends BaseDatabaseManager{ | ||
|
||
@Override | ||
void getData() { | ||
System.out.println("Veri getirildi : My Sql"); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
3.gün ödev-33-45videolar/abstractDemo/src/OracleDatabaseManager.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
public class OracleDatabaseManager extends BaseDatabaseManager{ | ||
|
||
|
||
@Override | ||
void getData() { | ||
System.out.println("Veri getirildi : Oracle"); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
3.gün ödev-33-45videolar/abstractDemo/src/SqlServerDatabaseManager.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
public class SqlServerDatabaseManager extends BaseDatabaseManager{ | ||
|
||
@Override | ||
void getData() { | ||
System.out.println("Veri getirildi : Sql Server"); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
public interface IEatable { | ||
|
||
void eat (); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
public interface IPayable { | ||
|
||
void Pay(); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
public interface IWorkable { | ||
|
||
void work(); | ||
//ortak operasyonlar. örn mesaiye kalmak | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
public class Main { | ||
public static void main(String[] args) | ||
{ | ||
System.out.println("Hello world!"); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
3.gün ödev-33-45videolar/interfaceDemo/src/OutsourceWorker.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
public class OutsourceWorker implements IWorkable{ | ||
|
||
@Override | ||
public void work() { | ||
|
||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//bizim çalışanımız | ||
public class Worker implements IWorkable, IEatable, IPayable{ | ||
|
||
@Override | ||
public void work() { | ||
|
||
} | ||
|
||
@Override | ||
public void eat() { | ||
|
||
} | ||
|
||
@Override | ||
public void Pay() { | ||
|
||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
3.gün ödev-33-45videolar/interfaces/src/CustomerManager.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
public class CustomerManager { | ||
|
||
private ICustomerDal customerDal; | ||
|
||
public CustomerManager(ICustomerDal customerDal) | ||
{ | ||
this.customerDal = customerDal; | ||
} | ||
|
||
public void add() | ||
{ | ||
customerDal.add(); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
public interface ICustomerDal { | ||
|
||
void add(); | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
public interface IRepository { | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
public class Main { | ||
public static void main(String[] args) | ||
{ | ||
CustomerManager customerManager = new CustomerManager(new OracleCustomerDal()); | ||
customerManager.add(); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
3.gün ödev-33-45videolar/interfaces/src/MySqlCustomerDal.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
public class MySqlCustomerDal implements ICustomerDal, IRepository{ | ||
@Override | ||
public void add() { | ||
System.out.println("My Sql eklendi"); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
3.gün ödev-33-45videolar/interfaces/src/OracleCustomerDal.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
public class OracleCustomerDal implements ICustomerDal{ | ||
@Override | ||
public void add() { | ||
System.out.println("Oracle eklendi"); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
3.gün ödev-33-45videolar/overriding/src/BaseKrediManager.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
public class BaseKrediManager { | ||
|
||
public final double hesapla(double tutar) | ||
{ | ||
return tutar * 1.18; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
public class Main { | ||
public static void main(String[] args) | ||
{ | ||
// OgretmenKrediManager ogretmenKrediManager = new OgretmenKrediManager(); | ||
// System.out.println(ogretmenKrediManager.hesapla(1000)); | ||
|
||
BaseKrediManager[] krediManagers = new BaseKrediManager[]{new OgretmenKrediManager(), new TarımKrediManager(), new OgrenciKrediManager()}; | ||
for (BaseKrediManager krediManager: krediManagers | ||
) { | ||
System.out.println(krediManager.hesapla(1000)); | ||
} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
3.gün ödev-33-45videolar/overriding/src/OgrenciKrediManager.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
public class OgrenciKrediManager extends BaseKrediManager{ | ||
|
||
//BaseKrediManager'daki final keyword'ü yüzünden override işlemi engelleniyor ! | ||
// public double hesapla(double tutar) | ||
// { | ||
// return tutar * 1.10; | ||
// } | ||
} |
4 changes: 4 additions & 0 deletions
4
3.gün ödev-33-45videolar/overriding/src/OgretmenKrediManager.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
public class OgretmenKrediManager extends BaseKrediManager{ | ||
|
||
|
||
} |
2 changes: 2 additions & 0 deletions
2
3.gün ödev-33-45videolar/overriding/src/TarımKrediManager.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
public class TarımKrediManager extends BaseKrediManager{ | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
public class BaseLogger { | ||
|
||
public void log(String message) | ||
{ | ||
|
||
} | ||
|
||
} |
7 changes: 7 additions & 0 deletions
7
3.gün ödev-33-45videolar/polimorfizmDemo/src/ConsoleLogger.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
public class ConsoleLogger extends BaseLogger{ | ||
|
||
public void log(String message) | ||
{ | ||
System.out.println("Log to console : " + message); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
3.gün ödev-33-45videolar/polimorfizmDemo/src/CustomerManager.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
public class CustomerManager { | ||
|
||
private BaseLogger logger; | ||
|
||
public CustomerManager(BaseLogger logger) | ||
{ | ||
this.logger = logger; | ||
} | ||
|
||
public void add() | ||
{ | ||
System.out.println("Müşteri eklendi"); | ||
this.logger.log("log mesajı"); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
3.gün ödev-33-45videolar/polimorfizmDemo/src/DatabaseLogger.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
public class DatabaseLogger extends BaseLogger{ | ||
|
||
public void log(String message) | ||
{ | ||
System.out.println("Log to database : " + message); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
3.gün ödev-33-45videolar/polimorfizmDemo/src/EmailLogger.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
public class EmailLogger extends BaseLogger{ | ||
|
||
public void log(String message) | ||
{ | ||
System.out.println("Log to Email : " + message); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
public class FileLogger extends BaseLogger{ | ||
|
||
public void log(String message) | ||
{ | ||
System.out.println("Log to file : " + message); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
public class Main { | ||
public static void main(String[] args) | ||
{ | ||
// BaseLogger[] loggers = new BaseLogger[]{new FileLogger(), new EmailLogger(), new DatabaseLogger(), new ConsoleLogger()}; | ||
// int[] sayilar = new int[] {1,2,3}; | ||
// | ||
// for (BaseLogger logger: loggers | ||
// ) { | ||
// logger.Log("Log mesajı"); | ||
// } | ||
|
||
CustomerManager customerManager = new CustomerManager(new DatabaseLogger()); | ||
customerManager.add(); | ||
|
||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
3.gün ödev-33-45videolar/referans tip değer tip/referanceType-valueType/src/Main.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
public class Main { | ||
public static void main(String[] args) | ||
{ | ||
int[] sayilar1 = new int[] {1,2,3}; | ||
int[] sayilar2 = new int[] {4,5,6}; | ||
sayilar2 = sayilar1; | ||
sayilar1[0] = 10; | ||
System.out.println(sayilar2[0]); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
3.gün ödev-33-45videolar/staticDemo/src/DatabaseHelper.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
public class DatabaseHelper { | ||
|
||
public static class Crud //Create Read Update Delete | ||
{ | ||
public static void Delete(){} | ||
|
||
public static void Update(){} | ||
} | ||
|
||
public static class Connection | ||
{ | ||
public static void createConnection(){} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
public class Main { | ||
public static void main(String[] args) | ||
{ | ||
ProductManager manager = new ProductManager(); | ||
Product product = new Product(); | ||
product.price=10; | ||
product.name=""; | ||
manager.add(product); | ||
|
||
DatabaseHelper.Crud.Delete(); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
public class Product { | ||
int id; | ||
String name; | ||
double price; | ||
|
||
} |
16 changes: 16 additions & 0 deletions
16
3.gün ödev-33-45videolar/staticDemo/src/ProductManager.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
public class ProductManager { | ||
|
||
public void add(Product product) | ||
{ | ||
|
||
if (ProductValidator.isValid(product)) | ||
{ | ||
System.out.println("Eklendi"); | ||
} | ||
else | ||
{ | ||
System.out.println("Ürün bilgileri geçersizdir"); | ||
} | ||
|
||
} | ||
} |
Oops, something went wrong.