├── .gitignore ├── README.md ├── extras └── logintest │ ├── bin │ ├── App.class │ └── kullanici.class │ └── src │ ├── App.java │ └── kullanici.java ├── spring └── rentACar │ ├── .gitignore │ ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── kodlama │ │ │ └── io │ │ │ └── rentACar │ │ │ ├── RentACarApplication.java │ │ │ ├── business │ │ │ ├── abstracts │ │ │ │ └── BrandService.java │ │ │ └── concretes │ │ │ │ └── BrandManager.java │ │ │ ├── dataAccess │ │ │ ├── abstracts │ │ │ │ └── BrandRepository.java │ │ │ └── concretes │ │ │ │ └── InMemoryBrandRepository.java │ │ │ ├── entities │ │ │ └── concretes │ │ │ │ └── Brand.java │ │ │ └── webApi │ │ │ └── controllers │ │ │ └── BrandsController.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── kodlama │ └── io │ └── rentACar │ └── RentACarApplicationTests.java ├── week1 ├── arkadasSayilar │ └── Main.java ├── arraysDemo │ └── Main.java ├── conditionals │ └── Main.java ├── datatypes │ └── Main.java ├── helloworld │ └── Main.java ├── loopDemo │ └── Main.java ├── miniProjeAsalSayi │ └── Main.java ├── mukemmelSayilar │ └── Main.java ├── multiDimensionalArrayDemo │ └── Main.java ├── recapDemo │ └── Main.java ├── recapDemo2 │ └── Main.java ├── sayiBulmaca │ └── Main.java ├── sesliHarfler │ └── Main.java ├── stringsDemo │ └── Main.java ├── switchDemo │ └── Main.java └── variables │ └── Main.java ├── week2 ├── Inheritance │ ├── bin │ │ ├── App.class │ │ ├── Customer.class │ │ ├── CustomerManager.class │ │ ├── Employee.class │ │ └── EmployeeManager.class │ └── src │ │ ├── App.java │ │ ├── Customer.java │ │ ├── CustomerManager.java │ │ ├── Employee.java │ │ ├── EmployeeManager.java │ │ ├── Person.java │ │ └── PersonManager.java ├── classes │ ├── bin │ │ ├── App.class │ │ └── CustomerManager.class │ └── src │ │ ├── App.java │ │ └── CustomerManager.java ├── classesWithAttributes │ ├── bin │ │ ├── App.class │ │ ├── ProductManager.class │ │ └── Products.class │ └── src │ │ ├── App.java │ │ ├── ProductManager.java │ │ └── Products.java ├── inheritanceDemo │ ├── bin │ │ ├── App.class │ │ ├── AskerKrediManager.class │ │ ├── BaseKrediManager.class │ │ ├── KrediUI.class │ │ ├── OgretmenKrediManager.class │ │ └── TarimKrediManager.class │ └── src │ │ ├── App.java │ │ ├── AskerKrediManager.java │ │ ├── BaseKrediManager.java │ │ ├── KrediUI.java │ │ ├── OgretmenKrediManager.java │ │ └── TarimKrediManager.java ├── methodOverloading │ ├── bin │ │ ├── App.class │ │ └── Dortislem.class │ └── src │ │ ├── App.java │ │ └── Dortislem.java ├── methods │ └── Main.java ├── methods2 │ └── Main.java ├── oop1 │ ├── .vscode │ │ └── settings.json │ ├── bin │ │ └── oop1 │ │ │ ├── CorporateCustomer.class │ │ │ ├── Customer.class │ │ │ ├── IndividualCustomer.class │ │ │ ├── Main.class │ │ │ └── Product.class │ └── src │ │ └── oop1 │ │ ├── CorporateCustomer.java │ │ ├── Customer.java │ │ ├── IndividualCustomer.java │ │ ├── Main.java │ │ └── Product.java └── reCapDemo_Classes │ ├── bin │ ├── App.class │ └── Dortislem.class │ └── src │ ├── App.java │ └── Dortislem.java ├── week3-sql ├── SQLQuery.sql ├── database (2).xlsx └── database.xlsx └── week3 ├── abstractClasses ├── .vscode │ └── settings.json ├── bin │ ├── App.class │ ├── GameCalculator.class │ ├── KidsGameCalculator.class │ ├── ManGameCalculator.class │ ├── OlderGameCalculator.class │ └── WomanGameCalculator.class └── src │ ├── App.java │ ├── GameCalculator.java │ ├── KidsGameCalculator.java │ ├── ManGameCalculator.java │ ├── OlderGameCalculator.java │ └── WomanGameCalculator.java ├── abstractDemo ├── bin │ ├── App.class │ ├── BaseDatabaseManager.class │ ├── CustomerManager.class │ ├── MySQLDatabaseManager.class │ ├── OracleDatabaseManager.class │ └── SQLServerDatabaseManager.class └── src │ ├── App.java │ ├── BaseDatabaseManager.java │ ├── CustomerManager.java │ ├── MySQLDatabaseManager.java │ ├── OracleDatabaseManager.java │ └── SQLServerDatabaseManager.java ├── interfaceDemo ├── bin │ ├── App.class │ ├── IEatable.class │ ├── IPayable.class │ ├── IWorkable.class │ ├── OutsourceWorker.class │ ├── Robot.class │ └── Worker.class └── src │ ├── App.java │ ├── IEatable.java │ ├── IPayable.java │ ├── IWorkable.java │ ├── OutsourceWorker.java │ ├── Robot.java │ └── Worker.java ├── interfaces ├── bin │ ├── App.class │ ├── CustomerManager.class │ ├── ICustomerDal.class │ ├── IRepository.class │ ├── MySqlCustomerDal.class │ ├── OracleCustomerDal.class │ └── SqlCustomerDal.class └── src │ ├── App.java │ ├── CustomerManager.java │ ├── ICustomerDal.java │ ├── IRepository.java │ ├── MySqlCustomerDal.java │ ├── OracleCustomerDal.java │ └── SqlCustomerDal.java ├── nLayered ├── bin │ ├── App.class │ ├── business │ │ ├── CategoryManager.class │ │ └── CourseManager.class │ ├── core │ │ ├── DatabaseLogger.class │ │ ├── FileLogger.class │ │ ├── MailLogger.class │ │ └── logger.class │ ├── dataAccess │ │ ├── DataDao.class │ │ ├── HibernateDataDao.class │ │ └── JdbcDataDao.class │ └── entities │ │ ├── Category.class │ │ ├── Course.class │ │ ├── Instructor.class │ │ └── User.class └── src │ ├── App.java │ ├── business │ ├── CategoryManager.java │ └── CourseManager.java │ ├── core │ ├── DatabaseLogger.java │ ├── FileLogger.java │ ├── MailLogger.java │ └── logger.java │ ├── dataAccess │ ├── DataDao.java │ ├── HibernateDataDao.java │ └── JdbcDataDao.java │ └── entities │ ├── Category.java │ ├── Course.java │ ├── Instructor.java │ └── User.java ├── oop1 ├── .vscode │ └── settings.json ├── bin │ └── oop1 │ │ ├── CorporateCustomer.class │ │ ├── Customer.class │ │ ├── IndividualCustomer.class │ │ ├── Main.class │ │ └── Product.class └── src │ └── oop1 │ ├── CorporateCustomer.java │ ├── Customer.java │ ├── IndividualCustomer.java │ ├── Main.java │ └── Product.java ├── oopWithNLayeredApp ├── .vscode │ ├── launch.json │ └── settings.json ├── bin │ └── oopWithNLayeredApp │ │ ├── App.class │ │ ├── business │ │ └── ProductManager.class │ │ ├── core │ │ └── logging │ │ │ ├── DatabaseLogger.class │ │ │ ├── FileLogger.class │ │ │ ├── Logger.class │ │ │ └── MailLogger.class │ │ ├── dataAccess │ │ ├── HibernateProductDao.class │ │ ├── JdbcProductDao.class │ │ └── ProductDao.class │ │ └── entities │ │ └── Product.class └── src │ └── oopWithNLayeredApp │ ├── App.java │ ├── business │ └── ProductManager.java │ ├── core │ └── logging │ │ ├── DatabaseLogger.java │ │ ├── FileLogger.java │ │ ├── Logger.java │ │ └── MailLogger.java │ ├── dataAccess │ ├── HibernateProductDao.java │ ├── JdbcProductDao.java │ └── ProductDao.java │ └── entities │ └── Product.java ├── overriding ├── bin │ ├── App.class │ ├── BaseKrediManager.class │ ├── OgrenciKrediManager.class │ ├── OgretmenKrediManager.class │ └── TarimKrediManager.class └── src │ ├── App.java │ ├── BaseKrediManager.java │ ├── OgrenciKrediManager.java │ ├── OgretmenKrediManager.java │ └── TarimKrediManager.java ├── polymorphismDemo ├── .vscode │ └── settings.json ├── bin │ ├── App.class │ ├── BaseLogger.class │ ├── ConsoleLogger.class │ ├── CustomerManager.class │ ├── DatabaseLogger.class │ ├── EmailLogger.class │ └── FileLogger.class └── src │ ├── App.java │ ├── BaseLogger.java │ ├── ConsoleLogger.java │ ├── CustomerManager.java │ ├── DatabaseLogger.java │ ├── EmailLogger.java │ └── FileLogger.java ├── staticDemo ├── bin │ ├── App.class │ ├── DatabaseHelper$Connection.class │ ├── DatabaseHelper$Crud.class │ ├── DatabaseHelper.class │ ├── Product.class │ ├── ProductManager.class │ └── ProductValidator.class └── src │ ├── App.java │ ├── DatabaseHelper.java │ ├── Product.java │ ├── ProductManager.java │ └── ProductValidator.java ├── ytDemo ├── bin │ ├── App.class │ ├── BaseCreditManager.class │ ├── CarCreditManager.class │ ├── Company.class │ ├── CreditManager.class │ ├── Customer.class │ ├── CustomerManager.class │ ├── MilitaryCreditManager.class │ ├── Person.class │ ├── TeacherCreditManager.class │ ├── iCreditManager.class │ └── main2.class └── src │ ├── App.java │ ├── BaseCreditManager.java │ ├── CarCreditManager.java │ ├── Company.java │ ├── CreditManager.java │ ├── Customer.java │ ├── CustomerManager.java │ ├── MilitaryCreditManager.java │ ├── Person.java │ ├── TeacherCreditManager.java │ ├── iCreditManager.java │ └── main2.java └── ytEgitim ├── bin └── App.class └── src └── App.java /.gitignore: -------------------------------------------------------------------------------- 1 | README.md 2 | .vscode 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #

Java Camp

2 | 3 | #

![174-1746684_java-java-logo-black-png-transparent-png](https://user-images.githubusercontent.com/40443383/191629490-f0f0c729-9e9b-44ba-8b8a-ff0d0e67b679.png) 4 | 5 | - kodlama.io 6 | 7 |

8 | 9 | -------------------------------------------------------------------------------- /extras/logintest/bin/App.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/extras/logintest/bin/App.class -------------------------------------------------------------------------------- /extras/logintest/bin/kullanici.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/extras/logintest/bin/kullanici.class -------------------------------------------------------------------------------- /extras/logintest/src/App.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | 3 | public class App { 4 | public static void main(String[] args) throws Exception { 5 | Scanner sc = new Scanner(System.in); 6 | 7 | String cevap1, cevap2; 8 | cevap1 = sc.next(); 9 | cevap2 = sc.next(); 10 | kullanici login = new kullanici("eren", "solmaz"); 11 | if(login.id.equals(cevap1) && login.pw.equals(cevap2)){ 12 | System.out.println("Giriş doğru"); 13 | 14 | } 15 | else{ 16 | System.out.println("Giriş hatalı"); 17 | } 18 | 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /extras/logintest/src/kullanici.java: -------------------------------------------------------------------------------- 1 | public class kullanici { 2 | public String id; 3 | public String pw; 4 | /** 5 | * @return the id 6 | */ 7 | public String getId() { 8 | return id; 9 | } 10 | /** 11 | * @param id the id to set 12 | */ 13 | public void setId(String id) { 14 | this.id = id; 15 | } 16 | /** 17 | * @param id 18 | * @param pw 19 | */ 20 | public kullanici(String id, String pw) { 21 | this.id = id; 22 | this.pw = pw; 23 | } 24 | /** 25 | * @return the pw 26 | */ 27 | public String getPw() { 28 | return pw; 29 | } 30 | /** 31 | * @param pw the pw to set 32 | */ 33 | public void setPw(String pw) { 34 | this.pw = pw; 35 | } 36 | 37 | 38 | } 39 | -------------------------------------------------------------------------------- /spring/rentACar/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /spring/rentACar/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/spring/rentACar/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /spring/rentACar/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.6/apache-maven-3.8.6-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar 3 | -------------------------------------------------------------------------------- /spring/rentACar/mvnw: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # https://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | # ---------------------------------------------------------------------------- 20 | 21 | # ---------------------------------------------------------------------------- 22 | # Maven Start Up Batch script 23 | # 24 | # Required ENV vars: 25 | # ------------------ 26 | # JAVA_HOME - location of a JDK home dir 27 | # 28 | # Optional ENV vars 29 | # ----------------- 30 | # M2_HOME - location of maven2's installed home dir 31 | # MAVEN_OPTS - parameters passed to the Java VM when running Maven 32 | # e.g. to debug Maven itself, use 33 | # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 34 | # MAVEN_SKIP_RC - flag to disable loading of mavenrc files 35 | # ---------------------------------------------------------------------------- 36 | 37 | if [ -z "$MAVEN_SKIP_RC" ] ; then 38 | 39 | if [ -f /usr/local/etc/mavenrc ] ; then 40 | . /usr/local/etc/mavenrc 41 | fi 42 | 43 | if [ -f /etc/mavenrc ] ; then 44 | . /etc/mavenrc 45 | fi 46 | 47 | if [ -f "$HOME/.mavenrc" ] ; then 48 | . "$HOME/.mavenrc" 49 | fi 50 | 51 | fi 52 | 53 | # OS specific support. $var _must_ be set to either true or false. 54 | cygwin=false; 55 | darwin=false; 56 | mingw=false 57 | case "`uname`" in 58 | CYGWIN*) cygwin=true ;; 59 | MINGW*) mingw=true;; 60 | Darwin*) darwin=true 61 | # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home 62 | # See https://developer.apple.com/library/mac/qa/qa1170/_index.html 63 | if [ -z "$JAVA_HOME" ]; then 64 | if [ -x "/usr/libexec/java_home" ]; then 65 | export JAVA_HOME="`/usr/libexec/java_home`" 66 | else 67 | export JAVA_HOME="/Library/Java/Home" 68 | fi 69 | fi 70 | ;; 71 | esac 72 | 73 | if [ -z "$JAVA_HOME" ] ; then 74 | if [ -r /etc/gentoo-release ] ; then 75 | JAVA_HOME=`java-config --jre-home` 76 | fi 77 | fi 78 | 79 | if [ -z "$M2_HOME" ] ; then 80 | ## resolve links - $0 may be a link to maven's home 81 | PRG="$0" 82 | 83 | # need this for relative symlinks 84 | while [ -h "$PRG" ] ; do 85 | ls=`ls -ld "$PRG"` 86 | link=`expr "$ls" : '.*-> \(.*\)$'` 87 | if expr "$link" : '/.*' > /dev/null; then 88 | PRG="$link" 89 | else 90 | PRG="`dirname "$PRG"`/$link" 91 | fi 92 | done 93 | 94 | saveddir=`pwd` 95 | 96 | M2_HOME=`dirname "$PRG"`/.. 97 | 98 | # make it fully qualified 99 | M2_HOME=`cd "$M2_HOME" && pwd` 100 | 101 | cd "$saveddir" 102 | # echo Using m2 at $M2_HOME 103 | fi 104 | 105 | # For Cygwin, ensure paths are in UNIX format before anything is touched 106 | if $cygwin ; then 107 | [ -n "$M2_HOME" ] && 108 | M2_HOME=`cygpath --unix "$M2_HOME"` 109 | [ -n "$JAVA_HOME" ] && 110 | JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 111 | [ -n "$CLASSPATH" ] && 112 | CLASSPATH=`cygpath --path --unix "$CLASSPATH"` 113 | fi 114 | 115 | # For Mingw, ensure paths are in UNIX format before anything is touched 116 | if $mingw ; then 117 | [ -n "$M2_HOME" ] && 118 | M2_HOME="`(cd "$M2_HOME"; pwd)`" 119 | [ -n "$JAVA_HOME" ] && 120 | JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" 121 | fi 122 | 123 | if [ -z "$JAVA_HOME" ]; then 124 | javaExecutable="`which javac`" 125 | if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then 126 | # readlink(1) is not available as standard on Solaris 10. 127 | readLink=`which readlink` 128 | if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then 129 | if $darwin ; then 130 | javaHome="`dirname \"$javaExecutable\"`" 131 | javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" 132 | else 133 | javaExecutable="`readlink -f \"$javaExecutable\"`" 134 | fi 135 | javaHome="`dirname \"$javaExecutable\"`" 136 | javaHome=`expr "$javaHome" : '\(.*\)/bin'` 137 | JAVA_HOME="$javaHome" 138 | export JAVA_HOME 139 | fi 140 | fi 141 | fi 142 | 143 | if [ -z "$JAVACMD" ] ; then 144 | if [ -n "$JAVA_HOME" ] ; then 145 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 146 | # IBM's JDK on AIX uses strange locations for the executables 147 | JAVACMD="$JAVA_HOME/jre/sh/java" 148 | else 149 | JAVACMD="$JAVA_HOME/bin/java" 150 | fi 151 | else 152 | JAVACMD="`\\unset -f command; \\command -v java`" 153 | fi 154 | fi 155 | 156 | if [ ! -x "$JAVACMD" ] ; then 157 | echo "Error: JAVA_HOME is not defined correctly." >&2 158 | echo " We cannot execute $JAVACMD" >&2 159 | exit 1 160 | fi 161 | 162 | if [ -z "$JAVA_HOME" ] ; then 163 | echo "Warning: JAVA_HOME environment variable is not set." 164 | fi 165 | 166 | CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher 167 | 168 | # traverses directory structure from process work directory to filesystem root 169 | # first directory with .mvn subdirectory is considered project base directory 170 | find_maven_basedir() { 171 | 172 | if [ -z "$1" ] 173 | then 174 | echo "Path not specified to find_maven_basedir" 175 | return 1 176 | fi 177 | 178 | basedir="$1" 179 | wdir="$1" 180 | while [ "$wdir" != '/' ] ; do 181 | if [ -d "$wdir"/.mvn ] ; then 182 | basedir=$wdir 183 | break 184 | fi 185 | # workaround for JBEAP-8937 (on Solaris 10/Sparc) 186 | if [ -d "${wdir}" ]; then 187 | wdir=`cd "$wdir/.."; pwd` 188 | fi 189 | # end of workaround 190 | done 191 | echo "${basedir}" 192 | } 193 | 194 | # concatenates all lines of a file 195 | concat_lines() { 196 | if [ -f "$1" ]; then 197 | echo "$(tr -s '\n' ' ' < "$1")" 198 | fi 199 | } 200 | 201 | BASE_DIR=`find_maven_basedir "$(pwd)"` 202 | if [ -z "$BASE_DIR" ]; then 203 | exit 1; 204 | fi 205 | 206 | ########################################################################################## 207 | # Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 208 | # This allows using the maven wrapper in projects that prohibit checking in binary data. 209 | ########################################################################################## 210 | if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then 211 | if [ "$MVNW_VERBOSE" = true ]; then 212 | echo "Found .mvn/wrapper/maven-wrapper.jar" 213 | fi 214 | else 215 | if [ "$MVNW_VERBOSE" = true ]; then 216 | echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." 217 | fi 218 | if [ -n "$MVNW_REPOURL" ]; then 219 | jarUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" 220 | else 221 | jarUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" 222 | fi 223 | while IFS="=" read key value; do 224 | case "$key" in (wrapperUrl) jarUrl="$value"; break ;; 225 | esac 226 | done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" 227 | if [ "$MVNW_VERBOSE" = true ]; then 228 | echo "Downloading from: $jarUrl" 229 | fi 230 | wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" 231 | if $cygwin; then 232 | wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` 233 | fi 234 | 235 | if command -v wget > /dev/null; then 236 | if [ "$MVNW_VERBOSE" = true ]; then 237 | echo "Found wget ... using wget" 238 | fi 239 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 240 | wget "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" 241 | else 242 | wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" 243 | fi 244 | elif command -v curl > /dev/null; then 245 | if [ "$MVNW_VERBOSE" = true ]; then 246 | echo "Found curl ... using curl" 247 | fi 248 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 249 | curl -o "$wrapperJarPath" "$jarUrl" -f 250 | else 251 | curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f 252 | fi 253 | 254 | else 255 | if [ "$MVNW_VERBOSE" = true ]; then 256 | echo "Falling back to using Java to download" 257 | fi 258 | javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" 259 | # For Cygwin, switch paths to Windows format before running javac 260 | if $cygwin; then 261 | javaClass=`cygpath --path --windows "$javaClass"` 262 | fi 263 | if [ -e "$javaClass" ]; then 264 | if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 265 | if [ "$MVNW_VERBOSE" = true ]; then 266 | echo " - Compiling MavenWrapperDownloader.java ..." 267 | fi 268 | # Compiling the Java class 269 | ("$JAVA_HOME/bin/javac" "$javaClass") 270 | fi 271 | if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 272 | # Running the downloader 273 | if [ "$MVNW_VERBOSE" = true ]; then 274 | echo " - Running MavenWrapperDownloader.java ..." 275 | fi 276 | ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") 277 | fi 278 | fi 279 | fi 280 | fi 281 | ########################################################################################## 282 | # End of extension 283 | ########################################################################################## 284 | 285 | export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} 286 | if [ "$MVNW_VERBOSE" = true ]; then 287 | echo $MAVEN_PROJECTBASEDIR 288 | fi 289 | MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" 290 | 291 | # For Cygwin, switch paths to Windows format before running java 292 | if $cygwin; then 293 | [ -n "$M2_HOME" ] && 294 | M2_HOME=`cygpath --path --windows "$M2_HOME"` 295 | [ -n "$JAVA_HOME" ] && 296 | JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` 297 | [ -n "$CLASSPATH" ] && 298 | CLASSPATH=`cygpath --path --windows "$CLASSPATH"` 299 | [ -n "$MAVEN_PROJECTBASEDIR" ] && 300 | MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` 301 | fi 302 | 303 | # Provide a "standardized" way to retrieve the CLI args that will 304 | # work with both Windows and non-Windows executions. 305 | MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" 306 | export MAVEN_CMD_LINE_ARGS 307 | 308 | WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 309 | 310 | exec "$JAVACMD" \ 311 | $MAVEN_OPTS \ 312 | $MAVEN_DEBUG_OPTS \ 313 | -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ 314 | "-Dmaven.home=${M2_HOME}" \ 315 | "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ 316 | ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" 317 | -------------------------------------------------------------------------------- /spring/rentACar/mvnw.cmd: -------------------------------------------------------------------------------- 1 | @REM ---------------------------------------------------------------------------- 2 | @REM Licensed to the Apache Software Foundation (ASF) under one 3 | @REM or more contributor license agreements. See the NOTICE file 4 | @REM distributed with this work for additional information 5 | @REM regarding copyright ownership. The ASF licenses this file 6 | @REM to you under the Apache License, Version 2.0 (the 7 | @REM "License"); you may not use this file except in compliance 8 | @REM with the License. You may obtain a copy of the License at 9 | @REM 10 | @REM https://www.apache.org/licenses/LICENSE-2.0 11 | @REM 12 | @REM Unless required by applicable law or agreed to in writing, 13 | @REM software distributed under the License is distributed on an 14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | @REM KIND, either express or implied. See the License for the 16 | @REM specific language governing permissions and limitations 17 | @REM under the License. 18 | @REM ---------------------------------------------------------------------------- 19 | 20 | @REM ---------------------------------------------------------------------------- 21 | @REM Maven Start Up Batch script 22 | @REM 23 | @REM Required ENV vars: 24 | @REM JAVA_HOME - location of a JDK home dir 25 | @REM 26 | @REM Optional ENV vars 27 | @REM M2_HOME - location of maven2's installed home dir 28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands 29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending 30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven 31 | @REM e.g. to debug Maven itself, use 32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files 34 | @REM ---------------------------------------------------------------------------- 35 | 36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' 37 | @echo off 38 | @REM set title of command window 39 | title %0 40 | @REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' 41 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 42 | 43 | @REM set %HOME% to equivalent of $HOME 44 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 45 | 46 | @REM Execute a user defined script before this one 47 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 48 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 49 | if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %* 50 | if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %* 51 | :skipRcPre 52 | 53 | @setlocal 54 | 55 | set ERROR_CODE=0 56 | 57 | @REM To isolate internal variables from possible post scripts, we use another setlocal 58 | @setlocal 59 | 60 | @REM ==== START VALIDATION ==== 61 | if not "%JAVA_HOME%" == "" goto OkJHome 62 | 63 | echo. 64 | echo Error: JAVA_HOME not found in your environment. >&2 65 | echo Please set the JAVA_HOME variable in your environment to match the >&2 66 | echo location of your Java installation. >&2 67 | echo. 68 | goto error 69 | 70 | :OkJHome 71 | if exist "%JAVA_HOME%\bin\java.exe" goto init 72 | 73 | echo. 74 | echo Error: JAVA_HOME is set to an invalid directory. >&2 75 | echo JAVA_HOME = "%JAVA_HOME%" >&2 76 | echo Please set the JAVA_HOME variable in your environment to match the >&2 77 | echo location of your Java installation. >&2 78 | echo. 79 | goto error 80 | 81 | @REM ==== END VALIDATION ==== 82 | 83 | :init 84 | 85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 86 | @REM Fallback to current working directory if not found. 87 | 88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 90 | 91 | set EXEC_DIR=%CD% 92 | set WDIR=%EXEC_DIR% 93 | :findBaseDir 94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 95 | cd .. 96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 97 | set WDIR=%CD% 98 | goto findBaseDir 99 | 100 | :baseDirFound 101 | set MAVEN_PROJECTBASEDIR=%WDIR% 102 | cd "%EXEC_DIR%" 103 | goto endDetectBaseDir 104 | 105 | :baseDirNotFound 106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 107 | cd "%EXEC_DIR%" 108 | 109 | :endDetectBaseDir 110 | 111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 112 | 113 | @setlocal EnableExtensions EnableDelayedExpansion 114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 116 | 117 | :endReadAdditionalConfig 118 | 119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 120 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" 121 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 122 | 123 | set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" 124 | 125 | FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( 126 | IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B 127 | ) 128 | 129 | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 130 | @REM This allows using the maven wrapper in projects that prohibit checking in binary data. 131 | if exist %WRAPPER_JAR% ( 132 | if "%MVNW_VERBOSE%" == "true" ( 133 | echo Found %WRAPPER_JAR% 134 | ) 135 | ) else ( 136 | if not "%MVNW_REPOURL%" == "" ( 137 | SET DOWNLOAD_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" 138 | ) 139 | if "%MVNW_VERBOSE%" == "true" ( 140 | echo Couldn't find %WRAPPER_JAR%, downloading it ... 141 | echo Downloading from: %DOWNLOAD_URL% 142 | ) 143 | 144 | powershell -Command "&{"^ 145 | "$webclient = new-object System.Net.WebClient;"^ 146 | "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ 147 | "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ 148 | "}"^ 149 | "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ 150 | "}" 151 | if "%MVNW_VERBOSE%" == "true" ( 152 | echo Finished downloading %WRAPPER_JAR% 153 | ) 154 | ) 155 | @REM End of extension 156 | 157 | @REM Provide a "standardized" way to retrieve the CLI args that will 158 | @REM work with both Windows and non-Windows executions. 159 | set MAVEN_CMD_LINE_ARGS=%* 160 | 161 | %MAVEN_JAVA_EXE% ^ 162 | %JVM_CONFIG_MAVEN_PROPS% ^ 163 | %MAVEN_OPTS% ^ 164 | %MAVEN_DEBUG_OPTS% ^ 165 | -classpath %WRAPPER_JAR% ^ 166 | "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^ 167 | %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* 168 | if ERRORLEVEL 1 goto error 169 | goto end 170 | 171 | :error 172 | set ERROR_CODE=1 173 | 174 | :end 175 | @endlocal & set ERROR_CODE=%ERROR_CODE% 176 | 177 | if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost 178 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 179 | if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat" 180 | if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd" 181 | :skipRcPost 182 | 183 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 184 | if "%MAVEN_BATCH_PAUSE%"=="on" pause 185 | 186 | if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE% 187 | 188 | cmd /C exit /B %ERROR_CODE% 189 | -------------------------------------------------------------------------------- /spring/rentACar/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.7.5 9 | 10 | 11 | kodlama.io 12 | rentACar 13 | 0.0.1-SNAPSHOT 14 | rentACar 15 | Demo project for Spring Boot 16 | 17 | 17 18 | 19 | 20 | 24 | 25 | org.springframework.boot 26 | spring-boot-starter-validation 27 | 28 | 29 | org.springframework.boot 30 | spring-boot-starter-web 31 | 32 | 33 | 34 | org.springframework.boot 35 | spring-boot-devtools 36 | runtime 37 | true 38 | 39 | 44 | 45 | org.springdoc 46 | springdoc-openapi-ui 47 | 1.6.6 48 | 49 | 50 | org.projectlombok 51 | lombok 52 | true 53 | 54 | 55 | org.springframework.boot 56 | spring-boot-starter-test 57 | test 58 | 59 | 60 | 61 | 62 | 63 | 64 | org.springframework.boot 65 | spring-boot-maven-plugin 66 | 67 | 68 | 69 | org.projectlombok 70 | lombok 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /spring/rentACar/src/main/java/kodlama/io/rentACar/RentACarApplication.java: -------------------------------------------------------------------------------- 1 | package kodlama.io.rentACar; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class RentACarApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(RentACarApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring/rentACar/src/main/java/kodlama/io/rentACar/business/abstracts/BrandService.java: -------------------------------------------------------------------------------- 1 | package kodlama.io.rentACar.business.abstracts; 2 | 3 | import java.util.List; 4 | 5 | import kodlama.io.rentACar.entities.concretes.Brand; 6 | 7 | public interface BrandService { 8 | List getAll(); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /spring/rentACar/src/main/java/kodlama/io/rentACar/business/concretes/BrandManager.java: -------------------------------------------------------------------------------- 1 | package kodlama.io.rentACar.business.concretes; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import kodlama.io.rentACar.business.abstracts.BrandService; 9 | import kodlama.io.rentACar.dataAccess.abstracts.BrandRepository; 10 | import kodlama.io.rentACar.entities.concretes.Brand; 11 | 12 | @Service //bu sınıf bir business nesnesidir 13 | public class BrandManager implements BrandService { 14 | private BrandRepository brandRepository; 15 | 16 | /** 17 | * @param brandRepository 18 | */ 19 | @Autowired 20 | public BrandManager(BrandRepository brandRepository) { 21 | this.brandRepository = brandRepository; 22 | } 23 | 24 | @Override 25 | public List getAll() { 26 | return brandRepository.getAll(); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /spring/rentACar/src/main/java/kodlama/io/rentACar/dataAccess/abstracts/BrandRepository.java: -------------------------------------------------------------------------------- 1 | package kodlama.io.rentACar.dataAccess.abstracts; 2 | 3 | import java.util.List; 4 | 5 | import kodlama.io.rentACar.entities.concretes.Brand; 6 | 7 | public interface BrandRepository { 8 | List getAll(); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /spring/rentACar/src/main/java/kodlama/io/rentACar/dataAccess/concretes/InMemoryBrandRepository.java: -------------------------------------------------------------------------------- 1 | package kodlama.io.rentACar.dataAccess.concretes; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import org.springframework.stereotype.Repository; 7 | 8 | import kodlama.io.rentACar.dataAccess.abstracts.BrandRepository; 9 | import kodlama.io.rentACar.entities.concretes.Brand; 10 | 11 | @Repository //bu sınıf bir DataAccess nesnesidir. 12 | public class InMemoryBrandRepository implements BrandRepository { 13 | 14 | List brands; 15 | 16 | public InMemoryBrandRepository() { 17 | brands = new ArrayList(); 18 | brands.add(new Brand(1, "BMW")); 19 | brands.add(new Brand(2, "Mercedes")); 20 | brands.add(new Brand(3, "Audi")); 21 | brands.add(new Brand(4, "Fiat")); 22 | brands.add(new Brand(5, "Renault")); 23 | } 24 | 25 | @Override 26 | public List getAll() { 27 | 28 | return brands; 29 | } 30 | 31 | 32 | } 33 | -------------------------------------------------------------------------------- /spring/rentACar/src/main/java/kodlama/io/rentACar/entities/concretes/Brand.java: -------------------------------------------------------------------------------- 1 | package kodlama.io.rentACar.entities.concretes; 2 | 3 | public class Brand { 4 | private int id; 5 | private String name; 6 | /** 7 | * 8 | */ 9 | public Brand() { 10 | } 11 | /** 12 | * @param id 13 | * @param name 14 | */ 15 | public Brand(int id, String name) { 16 | this.id = id; 17 | this.name = name; 18 | } 19 | /** 20 | * @return the id 21 | */ 22 | public int getId() { 23 | return id; 24 | } 25 | /** 26 | * @param id the id to set 27 | */ 28 | public void setId(int id) { 29 | this.id = id; 30 | } 31 | /** 32 | * @return the name 33 | */ 34 | public String getName() { 35 | return name; 36 | } 37 | /** 38 | * @param name the name to set 39 | */ 40 | public void setName(String name) { 41 | this.name = name; 42 | } 43 | 44 | 45 | } 46 | -------------------------------------------------------------------------------- /spring/rentACar/src/main/java/kodlama/io/rentACar/webApi/controllers/BrandsController.java: -------------------------------------------------------------------------------- 1 | package kodlama.io.rentACar.webApi.controllers; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import org.springframework.web.bind.annotation.RestController; 8 | 9 | import kodlama.io.rentACar.business.abstracts.BrandService; 10 | import kodlama.io.rentACar.entities.concretes.Brand; 11 | 12 | @RestController //annotation 13 | @RequestMapping("/api/brands") 14 | public class BrandsController { 15 | private BrandService brandService; 16 | 17 | /** 18 | * @param brandService 19 | */ 20 | public BrandsController(BrandService brandService) { 21 | this.brandService = brandService; 22 | } 23 | 24 | @GetMapping("/getall") 25 | public List getAll(){ 26 | return brandService.getAll(); 27 | } 28 | 29 | 30 | } 31 | -------------------------------------------------------------------------------- /spring/rentACar/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /spring/rentACar/src/test/java/kodlama/io/rentACar/RentACarApplicationTests.java: -------------------------------------------------------------------------------- 1 | package kodlama.io.rentACar; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class RentACarApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /week1/arkadasSayilar/Main.java: -------------------------------------------------------------------------------- 1 | public class Main { 2 | public static void main(String[] args) { 3 | 4 | int sayi1=220; 5 | int sayi2=284; 6 | int toplam1=0; 7 | int toplam2=0; 8 | 9 | for(int i=1;igenerate get and set ile hızlı şekilde tanımayabilirsiniz. 8 | * @return the id 9 | */ 10 | public int getId() { 11 | return id; 12 | } 13 | /** 14 | * @param id the id to set 15 | */ 16 | public void setId(int id) { 17 | this.id = id; 18 | } 19 | /** 20 | * @return the customerNumber 21 | */ 22 | public String getCustomerNumber() { 23 | return customerNumber; 24 | } 25 | /** 26 | * @param customerNumber the customerNumber to set 27 | */ 28 | public void setCustomerNumber(String customerNumber) { 29 | this.customerNumber = customerNumber; 30 | } 31 | /** 32 | * @return the phone 33 | */ 34 | public String getPhone() { 35 | return phone; 36 | } 37 | /** 38 | * @param phone the phone to set 39 | */ 40 | public void setPhone(String phone) { 41 | this.phone = phone; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /week2/oop1/src/oop1/IndividualCustomer.java: -------------------------------------------------------------------------------- 1 | package oop1; 2 | 3 | public class IndividualCustomer extends Customer { 4 | private String firstName; 5 | private String lastName; 6 | /** diğer classtan veri aldık customer 7 | * @return the firstName 8 | */ 9 | public String getFirstName() { 10 | return firstName; 11 | } 12 | /** 13 | * @param firstName the firstName to set 14 | */ 15 | public void setFirstName(String firstName) { 16 | this.firstName = firstName; 17 | } 18 | /** 19 | * @return the lastName 20 | */ 21 | public String getLastName() { 22 | return lastName; 23 | } 24 | /** 25 | * @param lastName the lastName to set 26 | */ 27 | public void setLastName(String lastName) { 28 | this.lastName = lastName; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /week2/oop1/src/oop1/Main.java: -------------------------------------------------------------------------------- 1 | 2 | package oop1; 3 | public class Main { 4 | public static void main(String[] args){ 5 | String mesaj = "Vade oranı"; 6 | 7 | Product product1 = new Product(); 8 | /*source>generate get and set ile hızlı şekilde tanımayabilirsiniz.*/ 9 | product1.setName("Delgi Kahve Makinesi"); 10 | product1.setDiscount(7); 11 | product1.setUnitPrice(7500); 12 | product1.setUnitsInStock(3); 13 | product1.setImageUrl("image.jpg"); 14 | 15 | Product product2 = new Product(); 16 | 17 | product2.setName("Legedi Kahve Makinesi"); 18 | product2.setDiscount(3); 19 | product2.setUnitPrice(5000); 20 | product2.setUnitsInStock(35); 21 | product2.setImageUrl("imaege.jpg"); 22 | 23 | Product product3 = new Product(); 24 | product3.setName("Dedo Kahve Makinesi"); 25 | product3.setDiscount(7); 26 | product3.setUnitPrice(700); 27 | product3.setUnitsInStock(6); 28 | product3.setImageUrl("imagee.jpg"); 29 | 30 | 31 | Product[] products = {product1, product2, product3}; 32 | 33 | //"for" sırayla productları gezer 1,2,3 34 | for (Product product : products) { 35 | System.out.println(product.getName()); 36 | } 37 | IndividualCustomer individualCustomer = new IndividualCustomer (); 38 | individualCustomer.setId(1); 39 | individualCustomer.setPhone("053252353"); 40 | individualCustomer.setCustomerNumber("12345"); 41 | individualCustomer.setFirstName("firstName"); 42 | individualCustomer.setLastName("lastName"); 43 | 44 | CorporateCustomer corporateCustomer = new CorporateCustomer(); 45 | corporateCustomer.setId(2); 46 | corporateCustomer.setPhone("phone"); 47 | corporateCustomer.setCustomerNumber("cust"); 48 | corporateCustomer.setCompanyName("name"); 49 | corporateCustomer.setTaxNumber("taxNumber"); 50 | 51 | Customer[] customers = {individualCustomer, corporateCustomer}; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /week2/oop1/src/oop1/Product.java: -------------------------------------------------------------------------------- 1 | package oop1; 2 | 3 | public class Product { 4 | String name; 5 | double unitPrice; 6 | double discount; 7 | String imageUrl; 8 | int unitsInStock; 9 | /** 10 | * @return the name 11 | */ 12 | public String getName() { 13 | return name; 14 | } 15 | /** 16 | * @param name the name to set 17 | */ 18 | public void setName(String name) { 19 | this.name = name; 20 | } 21 | /** 22 | * @return the unitPrice 23 | */ 24 | public double getUnitPrice() { 25 | return unitPrice; 26 | } 27 | /** 28 | * @param unitPrice the unitPrice to set 29 | */ 30 | public void setUnitPrice(double unitPrice) { 31 | this.unitPrice = unitPrice; 32 | } 33 | /** 34 | * @return the discount 35 | */ 36 | public double getDiscount() { 37 | return discount; 38 | } 39 | /** 40 | * @param discount the discount to set 41 | */ 42 | public void setDiscount(double discount) { 43 | this.discount = discount; 44 | } 45 | /** 46 | * @return the imageUrl 47 | */ 48 | public String getImageUrl() { 49 | return imageUrl; 50 | } 51 | /** 52 | * @param imageUrl the imageUrl to set 53 | */ 54 | public void setImageUrl(String imageUrl) { 55 | this.imageUrl = imageUrl; 56 | } 57 | /** 58 | * @return the unitsInStock 59 | */ 60 | public int getUnitsInStock() { 61 | return unitsInStock; 62 | } 63 | /** 64 | * @param unitsInStock the unitsInStock to set 65 | */ 66 | public void setUnitsInStock(int unitsInStock) { 67 | this.unitsInStock = unitsInStock; 68 | } 69 | } -------------------------------------------------------------------------------- /week2/reCapDemo_Classes/bin/App.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week2/reCapDemo_Classes/bin/App.class -------------------------------------------------------------------------------- /week2/reCapDemo_Classes/bin/Dortislem.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week2/reCapDemo_Classes/bin/Dortislem.class -------------------------------------------------------------------------------- /week2/reCapDemo_Classes/src/App.java: -------------------------------------------------------------------------------- 1 | public class App { 2 | public static void main(String[] args) { 3 | Dortislem dortislem = new Dortislem(); 4 | int sonuc; 5 | sonuc = dortislem.Topla(5, 4); 6 | System.out.println(sonuc); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /week2/reCapDemo_Classes/src/Dortislem.java: -------------------------------------------------------------------------------- 1 | public class Dortislem { 2 | 3 | public int Topla(int sayi1, int sayi2){ 4 | return sayi1 + sayi2; 5 | 6 | } 7 | public int Cikar(int sayi1, int sayi2){ 8 | return sayi1 - sayi2; 9 | 10 | } 11 | public int Carp(int sayi1, int sayi2){ 12 | return sayi1 * sayi2; 13 | 14 | } 15 | public int Bol(int sayi1, int sayi2){ 16 | return sayi1 / sayi2; 17 | 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /week3-sql/SQLQuery.sql: -------------------------------------------------------------------------------- 1 | Select ContactName adi, CompanyName sirketadi, City sehir from Customers 2 | Select * from Customers where City = 'London' 3 | 4 | Select * from Products where CategoryID=1 or CategoryID=3 5 | 6 | Select * from Products where CategoryID=1 and UnitPrice<10 7 | 8 | Select * from Products order by UnitPrice desc 9 | 10 | select count(*) Adet from Products where CategoryID=1 11 | 12 | select CategoryID,count(*) from products where UnitPrice>20 13 | 14 | group by CategoryID having count(*)<10 15 | 16 | --innerjoin sadece iki tablodada eşleşen dataları getirir 17 | --left join yazıma göre soldaki tabloda olup sağdaki tabloda olmayan dataları getirir 18 | 19 | Select * from Products p inner join [Order Details] od on p.ProductID = od.ProductID inner join Orders o on o.OrderID = od.OrderID 20 | 21 | Select * from Customers c left join Orders o on c.CustomerId = o.CustomerId where o.CustomerId is null 22 | 23 | -------------------------------------------------------------------------------- /week3-sql/database (2).xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3-sql/database (2).xlsx -------------------------------------------------------------------------------- /week3-sql/database.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3-sql/database.xlsx -------------------------------------------------------------------------------- /week3/abstractClasses/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "java.project.sourcePaths": ["src"], 3 | "java.project.outputPath": "bin", 4 | "java.project.referencedLibraries": [ 5 | "lib/**/*.jar" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /week3/abstractClasses/bin/App.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/abstractClasses/bin/App.class -------------------------------------------------------------------------------- /week3/abstractClasses/bin/GameCalculator.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/abstractClasses/bin/GameCalculator.class -------------------------------------------------------------------------------- /week3/abstractClasses/bin/KidsGameCalculator.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/abstractClasses/bin/KidsGameCalculator.class -------------------------------------------------------------------------------- /week3/abstractClasses/bin/ManGameCalculator.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/abstractClasses/bin/ManGameCalculator.class -------------------------------------------------------------------------------- /week3/abstractClasses/bin/OlderGameCalculator.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/abstractClasses/bin/OlderGameCalculator.class -------------------------------------------------------------------------------- /week3/abstractClasses/bin/WomanGameCalculator.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/abstractClasses/bin/WomanGameCalculator.class -------------------------------------------------------------------------------- /week3/abstractClasses/src/App.java: -------------------------------------------------------------------------------- 1 | public class App { 2 | public static void main(String[] args) throws Exception { 3 | WomanGameCalculator wgc = new WomanGameCalculator(); 4 | wgc.gameOver(); 5 | wgc.hesapla(); 6 | KidsGameCalculator kgc = new KidsGameCalculator(); 7 | kgc.hesapla(); 8 | 9 | 10 | GameCalculator gameCalculator = new KidsGameCalculator(); 11 | gameCalculator.gameOver(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /week3/abstractClasses/src/GameCalculator.java: -------------------------------------------------------------------------------- 1 | public abstract class GameCalculator { 2 | //her classta tanımanmalı 3 | public abstract void hesapla(); 4 | 5 | 6 | 7 | //override edilmez 8 | public final void gameOver(){ 9 | System.out.println("Oyun bitti "); 10 | } 11 | 12 | 13 | } 14 | -------------------------------------------------------------------------------- /week3/abstractClasses/src/KidsGameCalculator.java: -------------------------------------------------------------------------------- 1 | public class KidsGameCalculator extends GameCalculator { 2 | 3 | @Override 4 | public void hesapla(){ 5 | System.out.println("Puanınız : 100 "); 6 | } 7 | 8 | 9 | } 10 | -------------------------------------------------------------------------------- /week3/abstractClasses/src/ManGameCalculator.java: -------------------------------------------------------------------------------- 1 | public class ManGameCalculator extends GameCalculator { 2 | @Override 3 | public void hesapla(){ 4 | System.out.println("Puanınız : 80 "); 5 | } 6 | 7 | 8 | } 9 | -------------------------------------------------------------------------------- /week3/abstractClasses/src/OlderGameCalculator.java: -------------------------------------------------------------------------------- 1 | public class OlderGameCalculator extends GameCalculator{ 2 | 3 | @Override 4 | public void hesapla() { 5 | // TODO Auto-generated method stub 6 | 7 | } 8 | 9 | 10 | } 11 | -------------------------------------------------------------------------------- /week3/abstractClasses/src/WomanGameCalculator.java: -------------------------------------------------------------------------------- 1 | public class WomanGameCalculator extends GameCalculator { 2 | @Override 3 | public void hesapla(){ 4 | System.out.println("Puanınız : 90 "); 5 | } 6 | 7 | 8 | } 9 | -------------------------------------------------------------------------------- /week3/abstractDemo/bin/App.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/abstractDemo/bin/App.class -------------------------------------------------------------------------------- /week3/abstractDemo/bin/BaseDatabaseManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/abstractDemo/bin/BaseDatabaseManager.class -------------------------------------------------------------------------------- /week3/abstractDemo/bin/CustomerManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/abstractDemo/bin/CustomerManager.class -------------------------------------------------------------------------------- /week3/abstractDemo/bin/MySQLDatabaseManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/abstractDemo/bin/MySQLDatabaseManager.class -------------------------------------------------------------------------------- /week3/abstractDemo/bin/OracleDatabaseManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/abstractDemo/bin/OracleDatabaseManager.class -------------------------------------------------------------------------------- /week3/abstractDemo/bin/SQLServerDatabaseManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/abstractDemo/bin/SQLServerDatabaseManager.class -------------------------------------------------------------------------------- /week3/abstractDemo/src/App.java: -------------------------------------------------------------------------------- 1 | public class App { 2 | public static void main(String[] args) throws Exception { 3 | CustomerManager customerManager = new CustomerManager(); 4 | customerManager.databaseManager = new SQLServerDatabaseManager(); 5 | customerManager.getCustomers(); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /week3/abstractDemo/src/BaseDatabaseManager.java: -------------------------------------------------------------------------------- 1 | public abstract class BaseDatabaseManager { 2 | public abstract void getData(); 3 | 4 | } 5 | -------------------------------------------------------------------------------- /week3/abstractDemo/src/CustomerManager.java: -------------------------------------------------------------------------------- 1 | public class CustomerManager { 2 | 3 | BaseDatabaseManager databaseManager; 4 | 5 | public void getCustomers(){ 6 | databaseManager.getData(); 7 | 8 | } 9 | 10 | 11 | } 12 | -------------------------------------------------------------------------------- /week3/abstractDemo/src/MySQLDatabaseManager.java: -------------------------------------------------------------------------------- 1 | public class MySQLDatabaseManager extends BaseDatabaseManager { 2 | 3 | @Override 4 | public void getData() { 5 | System.out.println("Veri getirildi MYSQL"); 6 | 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /week3/abstractDemo/src/OracleDatabaseManager.java: -------------------------------------------------------------------------------- 1 | public class OracleDatabaseManager extends BaseDatabaseManager { 2 | 3 | @Override 4 | public void getData() { 5 | System.out.println("Veri getirildi ORACLE"); 6 | 7 | } 8 | 9 | 10 | } 11 | -------------------------------------------------------------------------------- /week3/abstractDemo/src/SQLServerDatabaseManager.java: -------------------------------------------------------------------------------- 1 | public class SQLServerDatabaseManager extends BaseDatabaseManager { 2 | 3 | @Override 4 | public void getData() { 5 | System.out.println("Veri getirildi SQLSERVER"); 6 | 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /week3/interfaceDemo/bin/App.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/interfaceDemo/bin/App.class -------------------------------------------------------------------------------- /week3/interfaceDemo/bin/IEatable.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/interfaceDemo/bin/IEatable.class -------------------------------------------------------------------------------- /week3/interfaceDemo/bin/IPayable.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/interfaceDemo/bin/IPayable.class -------------------------------------------------------------------------------- /week3/interfaceDemo/bin/IWorkable.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/interfaceDemo/bin/IWorkable.class -------------------------------------------------------------------------------- /week3/interfaceDemo/bin/OutsourceWorker.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/interfaceDemo/bin/OutsourceWorker.class -------------------------------------------------------------------------------- /week3/interfaceDemo/bin/Robot.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/interfaceDemo/bin/Robot.class -------------------------------------------------------------------------------- /week3/interfaceDemo/bin/Worker.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/interfaceDemo/bin/Worker.class -------------------------------------------------------------------------------- /week3/interfaceDemo/src/App.java: -------------------------------------------------------------------------------- 1 | public class App { 2 | public static void main(String[] args) throws Exception { 3 | System.out.println("Hello, World!"); 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /week3/interfaceDemo/src/IEatable.java: -------------------------------------------------------------------------------- 1 | public interface IEatable { 2 | void eat(); 3 | 4 | } 5 | -------------------------------------------------------------------------------- /week3/interfaceDemo/src/IPayable.java: -------------------------------------------------------------------------------- 1 | public interface IPayable { 2 | void pay(); 3 | 4 | } 5 | -------------------------------------------------------------------------------- /week3/interfaceDemo/src/IWorkable.java: -------------------------------------------------------------------------------- 1 | public interface IWorkable { 2 | void work(); 3 | 4 | } 5 | -------------------------------------------------------------------------------- /week3/interfaceDemo/src/OutsourceWorker.java: -------------------------------------------------------------------------------- 1 | public class OutsourceWorker implements IWorkable { 2 | 3 | @Override 4 | public void work() { 5 | // TODO Auto-generated method stub 6 | 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /week3/interfaceDemo/src/Robot.java: -------------------------------------------------------------------------------- 1 | public class Robot implements IWorkable { 2 | 3 | @Override 4 | public void work() { 5 | 6 | } 7 | 8 | } 9 | -------------------------------------------------------------------------------- /week3/interfaceDemo/src/Worker.java: -------------------------------------------------------------------------------- 1 | public class Worker implements IWorkable, IEatable, IPayable { 2 | 3 | @Override 4 | public void work() { 5 | 6 | } 7 | 8 | @Override 9 | public void eat() { 10 | 11 | } 12 | 13 | @Override 14 | public void pay() { 15 | 16 | } 17 | 18 | 19 | } 20 | -------------------------------------------------------------------------------- /week3/interfaces/bin/App.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/interfaces/bin/App.class -------------------------------------------------------------------------------- /week3/interfaces/bin/CustomerManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/interfaces/bin/CustomerManager.class -------------------------------------------------------------------------------- /week3/interfaces/bin/ICustomerDal.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/interfaces/bin/ICustomerDal.class -------------------------------------------------------------------------------- /week3/interfaces/bin/IRepository.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/interfaces/bin/IRepository.class -------------------------------------------------------------------------------- /week3/interfaces/bin/MySqlCustomerDal.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/interfaces/bin/MySqlCustomerDal.class -------------------------------------------------------------------------------- /week3/interfaces/bin/OracleCustomerDal.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/interfaces/bin/OracleCustomerDal.class -------------------------------------------------------------------------------- /week3/interfaces/bin/SqlCustomerDal.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/interfaces/bin/SqlCustomerDal.class -------------------------------------------------------------------------------- /week3/interfaces/src/App.java: -------------------------------------------------------------------------------- 1 | public class App { 2 | public static void main(String[] args) throws Exception { 3 | CustomerManager customerManager = new CustomerManager(new SqlCustomerDal()); 4 | customerManager.add(); 5 | 6 | }; 7 | } 8 | -------------------------------------------------------------------------------- /week3/interfaces/src/CustomerManager.java: -------------------------------------------------------------------------------- 1 | public class CustomerManager { 2 | private ICustomerDal customerDal; 3 | 4 | public CustomerManager(ICustomerDal customerDal){ 5 | this.customerDal = customerDal; 6 | } 7 | 8 | public void add(){ 9 | customerDal.add(); 10 | 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /week3/interfaces/src/ICustomerDal.java: -------------------------------------------------------------------------------- 1 | public interface ICustomerDal { 2 | void add(); 3 | 4 | } 5 | -------------------------------------------------------------------------------- /week3/interfaces/src/IRepository.java: -------------------------------------------------------------------------------- 1 | public interface IRepository { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /week3/interfaces/src/MySqlCustomerDal.java: -------------------------------------------------------------------------------- 1 | public class MySqlCustomerDal implements ICustomerDal, IRepository { 2 | 3 | @Override 4 | public void add() { 5 | System.out.println("My sql eklendi"); 6 | 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /week3/interfaces/src/OracleCustomerDal.java: -------------------------------------------------------------------------------- 1 | public class OracleCustomerDal implements ICustomerDal { 2 | 3 | @Override 4 | public void add() { 5 | System.out.println("Oracle eklendi"); 6 | 7 | } 8 | 9 | 10 | } 11 | -------------------------------------------------------------------------------- /week3/interfaces/src/SqlCustomerDal.java: -------------------------------------------------------------------------------- 1 | public class SqlCustomerDal implements ICustomerDal{ 2 | 3 | @Override 4 | public void add() { 5 | System.out.println("Sql eklendi"); 6 | 7 | 8 | 9 | } 10 | 11 | 12 | } 13 | -------------------------------------------------------------------------------- /week3/nLayered/bin/App.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/nLayered/bin/App.class -------------------------------------------------------------------------------- /week3/nLayered/bin/business/CategoryManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/nLayered/bin/business/CategoryManager.class -------------------------------------------------------------------------------- /week3/nLayered/bin/business/CourseManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/nLayered/bin/business/CourseManager.class -------------------------------------------------------------------------------- /week3/nLayered/bin/core/DatabaseLogger.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/nLayered/bin/core/DatabaseLogger.class -------------------------------------------------------------------------------- /week3/nLayered/bin/core/FileLogger.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/nLayered/bin/core/FileLogger.class -------------------------------------------------------------------------------- /week3/nLayered/bin/core/MailLogger.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/nLayered/bin/core/MailLogger.class -------------------------------------------------------------------------------- /week3/nLayered/bin/core/logger.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/nLayered/bin/core/logger.class -------------------------------------------------------------------------------- /week3/nLayered/bin/dataAccess/DataDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/nLayered/bin/dataAccess/DataDao.class -------------------------------------------------------------------------------- /week3/nLayered/bin/dataAccess/HibernateDataDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/nLayered/bin/dataAccess/HibernateDataDao.class -------------------------------------------------------------------------------- /week3/nLayered/bin/dataAccess/JdbcDataDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/nLayered/bin/dataAccess/JdbcDataDao.class -------------------------------------------------------------------------------- /week3/nLayered/bin/entities/Category.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/nLayered/bin/entities/Category.class -------------------------------------------------------------------------------- /week3/nLayered/bin/entities/Course.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/nLayered/bin/entities/Course.class -------------------------------------------------------------------------------- /week3/nLayered/bin/entities/Instructor.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/nLayered/bin/entities/Instructor.class -------------------------------------------------------------------------------- /week3/nLayered/bin/entities/User.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/nLayered/bin/entities/User.class -------------------------------------------------------------------------------- /week3/nLayered/src/App.java: -------------------------------------------------------------------------------- 1 | import java.util.ArrayList; 2 | import java.util.List; 3 | 4 | import business.CategoryManager; 5 | import business.CourseManager; 6 | import core.DatabaseLogger; 7 | import core.FileLogger; 8 | import core.MailLogger; 9 | import core.logger; 10 | import dataAccess.HibernateDataDao; 11 | import dataAccess.JdbcDataDao; 12 | import entities.Category; 13 | import entities.Course; 14 | import entities.Instructor; 15 | import entities.User; 16 | 17 | public class App { 18 | public static void main(String[] args) throws Exception { 19 | logger[] log ={new DatabaseLogger(), new MailLogger(), new FileLogger()}; 20 | 21 | 22 | 23 | System.out.println("-----Categories-----"); 24 | Category programlama = new Category(176, "Programlama", "Programlama kategorisi"); 25 | Category programlama1 = new Category(176, "Programlama", "Programlama kategorisi"); 26 | Category diger = new Category(353, "Diger", "Digerleri"); 27 | 28 | List ctl = new ArrayList<>(); 29 | CategoryManager ctm = new CategoryManager(ctl, new JdbcDataDao(), log); 30 | ctm.add(programlama); 31 | //System.out.println("-----Exception Kategori isimleri-----"); 32 | //ctm.add(programlama1); 33 | 34 | System.out.println("-----Course-----"); 35 | 36 | Course java = new Course(1, "Java yetistirme campi", "Programlama", "Engin Demirog", 50); 37 | Course java1 = new Course(1, "Java yetistirme campi", "Programlama", "Engin Demirog", 50); 38 | Course dotnet = new Course(2, "Dotnet yetistirme campi", "Programlama", "Engin Demirog", 100); 39 | Course javascript = new Course(3, "Javascript yetistirme campi", "Programlama", "Engin Demirog", -1); 40 | 41 | List cml = new ArrayList<>(); 42 | 43 | CourseManager cm = new CourseManager(cml, new HibernateDataDao(), log); 44 | cm.add(java); 45 | System.out.println("-----Course-----"); 46 | cm.add(dotnet); 47 | 48 | /* System.out.println("-----Exception Kurs isimleri-----"); 49 | cm.add(java1); 50 | System.out.println("-----Exception Price-----"); 51 | cm.add(javascript); */ 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | Instructor egitmen = new Instructor("Engin Demirog", null); 60 | 61 | User kullanici = new User(1, "Eren Solmaz", null, 22); 62 | 63 | 64 | System.out.println(programlama.getCategoryName()); 65 | 66 | 67 | 68 | 69 | 70 | 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /week3/nLayered/src/business/CategoryManager.java: -------------------------------------------------------------------------------- 1 | package business; 2 | 3 | import java.util.List; 4 | 5 | import core.logger; 6 | import dataAccess.DataDao; 7 | import entities.Category; 8 | 9 | public class CategoryManager { 10 | private List categories; 11 | private DataDao dataDao; 12 | private logger[] loggers; 13 | /** 14 | * @param categories 15 | * @param dataDao 16 | * @param loggers 17 | */ 18 | public CategoryManager(List categories, DataDao dataDao, logger[] loggers) { 19 | this.categories = categories; 20 | this.dataDao = dataDao; 21 | this.loggers = loggers; 22 | } 23 | public void add(Category category) throws Exception{ 24 | for(Category categories : categories){ 25 | if(categories.getCategoryName().equals(category.getCategoryName())){ 26 | throw new Exception("Kategori isimleri aynı olamaz"); 27 | 28 | } 29 | } 30 | dataDao.add(category); 31 | categories.add(category); 32 | 33 | 34 | for (logger logger : loggers) { 35 | logger.log(category.getCategoryName()); 36 | 37 | } 38 | } 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /week3/nLayered/src/business/CourseManager.java: -------------------------------------------------------------------------------- 1 | package business; 2 | 3 | import java.util.List; 4 | 5 | import core.logger; 6 | import dataAccess.DataDao; 7 | import entities.Course; 8 | 9 | public class CourseManager { 10 | private List courses; 11 | private DataDao dataDao; 12 | private logger[] loggers; 13 | /** 14 | * @param courses 15 | * @param dataDao 16 | * @param loggers 17 | */ 18 | public CourseManager(List courses, DataDao dataDao, logger[] loggers) { 19 | this.courses = courses; 20 | this.dataDao = dataDao; 21 | this.loggers = loggers; 22 | } 23 | 24 | public void add(Course course) throws Exception{ 25 | if(course.getCoursePrice()<0){ 26 | throw new Exception("Kurs fiyatı 0'dan küçük olamaz"); 27 | 28 | } 29 | 30 | 31 | 32 | for(Course courses : courses){ 33 | if(courses.getCourseName().equals(course.getCourseName())){ 34 | throw new Exception("Kurs isimleri aynı olamaz"); 35 | } 36 | } 37 | dataDao.add(course); 38 | courses.add(course); 39 | 40 | for (logger logger : loggers) { 41 | logger.log(course.getCourseName()); 42 | 43 | } 44 | 45 | 46 | } 47 | } -------------------------------------------------------------------------------- /week3/nLayered/src/core/DatabaseLogger.java: -------------------------------------------------------------------------------- 1 | package core; 2 | 3 | public class DatabaseLogger implements logger { 4 | 5 | @Override 6 | public void log(String data) { 7 | System.out.println("Database Logged: "+ data); 8 | 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /week3/nLayered/src/core/FileLogger.java: -------------------------------------------------------------------------------- 1 | package core; 2 | 3 | public class FileLogger implements logger { 4 | 5 | @Override 6 | public void log(String data) { 7 | System.out.println("File logged: "+ data); 8 | 9 | } 10 | 11 | 12 | } 13 | -------------------------------------------------------------------------------- /week3/nLayered/src/core/MailLogger.java: -------------------------------------------------------------------------------- 1 | package core; 2 | 3 | public class MailLogger implements logger { 4 | 5 | @Override 6 | public void log(String data) { 7 | System.out.println("Mail logged: "+ data); 8 | 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /week3/nLayered/src/core/logger.java: -------------------------------------------------------------------------------- 1 | package core; 2 | 3 | public interface logger { 4 | void log(String data); 5 | 6 | } 7 | -------------------------------------------------------------------------------- /week3/nLayered/src/dataAccess/DataDao.java: -------------------------------------------------------------------------------- 1 | package dataAccess; 2 | 3 | import entities.Category; 4 | import entities.Course; 5 | import entities.Instructor; 6 | import entities.User; 7 | 8 | public interface DataDao { 9 | void add(User user); 10 | void add(Category category); 11 | void add(Course course); 12 | void add(Instructor instructor); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /week3/nLayered/src/dataAccess/HibernateDataDao.java: -------------------------------------------------------------------------------- 1 | package dataAccess; 2 | 3 | import javax.xml.crypto.Data; 4 | 5 | import entities.Category; 6 | import entities.Course; 7 | import entities.Instructor; 8 | import entities.User; 9 | 10 | public class HibernateDataDao implements DataDao { 11 | 12 | @Override 13 | public void add(User user) { 14 | System.out.println("User added with Hibernate"); 15 | 16 | } 17 | 18 | @Override 19 | public void add(Category category) { 20 | System.out.println("Category added with Hibernate"); 21 | } 22 | 23 | @Override 24 | public void add(Course course) { 25 | System.out.println("Course added with Hibernate"); 26 | 27 | } 28 | 29 | @Override 30 | public void add(Instructor instructor) { 31 | System.out.println("Instructor added with Hibernate"); 32 | 33 | } 34 | 35 | 36 | } 37 | -------------------------------------------------------------------------------- /week3/nLayered/src/dataAccess/JdbcDataDao.java: -------------------------------------------------------------------------------- 1 | package dataAccess; 2 | 3 | import javax.xml.crypto.Data; 4 | 5 | import entities.Category; 6 | import entities.Course; 7 | import entities.Instructor; 8 | import entities.User; 9 | 10 | public class JdbcDataDao implements DataDao { 11 | 12 | @Override 13 | public void add(User user) { 14 | System.out.println("User added with JDBC"); 15 | 16 | } 17 | 18 | @Override 19 | public void add(Category category) { 20 | System.out.println("Category added with JDBC"); 21 | } 22 | 23 | @Override 24 | public void add(Course course) { 25 | System.out.println("Course added with JDBC"); 26 | 27 | } 28 | 29 | @Override 30 | public void add(Instructor instructor) { 31 | System.out.println("Instructor added with JDBC"); 32 | 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /week3/nLayered/src/entities/Category.java: -------------------------------------------------------------------------------- 1 | package entities; 2 | 3 | public class Category { 4 | private int categoryId; 5 | private String categoryName; 6 | private String categoryDescription; 7 | /** 8 | * @param categoryId 9 | * @param categoryName 10 | * @param categoryDescription 11 | */ 12 | public Category(int categoryId, String categoryName, String categoryDescription) { 13 | this.categoryId = categoryId; 14 | this.categoryName = categoryName; 15 | this.categoryDescription = categoryDescription; 16 | } 17 | /** 18 | * @return the categoryId 19 | */ 20 | public int getCategoryId() { 21 | return categoryId; 22 | } 23 | /** 24 | * @param categoryId the categoryId to set 25 | */ 26 | public void setCategoryId(int categoryId) { 27 | this.categoryId = categoryId; 28 | } 29 | /** 30 | * @return the categoryName 31 | */ 32 | public String getCategoryName() { 33 | return categoryName; 34 | } 35 | /** 36 | * @param categoryName the categoryName to set 37 | */ 38 | public void setCategoryName(String categoryName) { 39 | this.categoryName = categoryName; 40 | } 41 | /** 42 | * @return the categoryDescription 43 | */ 44 | public String getCategoryDescription() { 45 | return categoryDescription; 46 | } 47 | /** 48 | * @param categoryDescription the categoryDescription to set 49 | */ 50 | public void setCategoryDescription(String categoryDescription) { 51 | this.categoryDescription = categoryDescription; 52 | } 53 | 54 | 55 | } 56 | -------------------------------------------------------------------------------- /week3/nLayered/src/entities/Course.java: -------------------------------------------------------------------------------- 1 | package entities; 2 | 3 | import javax.xml.catalog.CatalogException; 4 | 5 | public class Course { 6 | private int courseId; 7 | private String courseName; 8 | private String courseCategory; 9 | private String instructor; 10 | private double coursePrice; 11 | /** 12 | * @param courseId 13 | * @param courseName 14 | * @param courseCategory 15 | * @param instructor 16 | * @param coursePrice 17 | */ 18 | public Course(int courseId, String courseName, String courseCategory, String instructor, double coursePrice) { 19 | this.courseId = courseId; 20 | this.courseName = courseName; 21 | this.courseCategory = courseCategory; 22 | this.instructor = instructor; 23 | this.coursePrice = coursePrice; 24 | } 25 | /** 26 | * @return the courseId 27 | */ 28 | public int getCourseId() { 29 | return courseId; 30 | } 31 | /** 32 | * @param courseId the courseId to set 33 | */ 34 | public void setCourseId(int courseId) { 35 | this.courseId = courseId; 36 | } 37 | /** 38 | * @return the courseName 39 | */ 40 | public String getCourseName() { 41 | return courseName; 42 | } 43 | /** 44 | * @param courseName the courseName to set 45 | */ 46 | public void setCourseName(String courseName) { 47 | this.courseName = courseName; 48 | } 49 | /** 50 | * @return the courseCategory 51 | */ 52 | public String getCourseCategory() { 53 | return courseCategory; 54 | } 55 | /** 56 | * @param courseCategory the courseCategory to set 57 | */ 58 | public void setCourseCategory(String courseCategory) { 59 | this.courseCategory = courseCategory; 60 | } 61 | /** 62 | * @return the instructor 63 | */ 64 | public String getInstructor() { 65 | return instructor; 66 | } 67 | /** 68 | * @param instructor the instructor to set 69 | */ 70 | public void setInstructor(String instructor) { 71 | this.instructor = instructor; 72 | } 73 | /** 74 | * @return the coursePrice 75 | */ 76 | public double getCoursePrice() { 77 | return coursePrice; 78 | } 79 | /** 80 | * @param coursePrice the coursePrice to set 81 | */ 82 | public void setCoursePrice(double coursePrice) { 83 | this.coursePrice = coursePrice; 84 | } 85 | 86 | 87 | 88 | } 89 | -------------------------------------------------------------------------------- /week3/nLayered/src/entities/Instructor.java: -------------------------------------------------------------------------------- 1 | package entities; 2 | 3 | public class Instructor { 4 | private String instructorFullName; 5 | private String instrructorDescription; 6 | /** 7 | * @param instructorFullName 8 | * @param instrructorDescription 9 | */ 10 | public Instructor(String instructorFullName, String instrructorDescription) { 11 | this.instructorFullName = instructorFullName; 12 | this.instrructorDescription = instrructorDescription; 13 | } 14 | /** 15 | * @return the instructorFullName 16 | */ 17 | public String getInstructorFullName() { 18 | return instructorFullName; 19 | } 20 | /** 21 | * @param instructorFullName the instructorFullName to set 22 | */ 23 | public void setInstructorFullName(String instructorFullName) { 24 | this.instructorFullName = instructorFullName; 25 | } 26 | /** 27 | * @return the instrructorDescription 28 | */ 29 | public String getInstrructorDescription() { 30 | return instrructorDescription; 31 | } 32 | /** 33 | * @param instrructorDescription the instrructorDescription to set 34 | */ 35 | public void setInstrructorDescription(String instrructorDescription) { 36 | this.instrructorDescription = instrructorDescription; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /week3/nLayered/src/entities/User.java: -------------------------------------------------------------------------------- 1 | package entities; 2 | 3 | public class User { 4 | private int userId; 5 | private String fullName; 6 | private String adres; 7 | private int age; 8 | /** 9 | * @param userId 10 | * @param fullName 11 | * @param adres 12 | * @param age 13 | */ 14 | public User(int userId, String fullName, String adres, int age) { 15 | this.userId = userId; 16 | this.fullName = fullName; 17 | this.adres = adres; 18 | this.age = age; 19 | } 20 | /** 21 | * @return the userId 22 | */ 23 | public int getUserId() { 24 | return userId; 25 | } 26 | /** 27 | * @param userId the userId to set 28 | */ 29 | public void setUserId(int userId) { 30 | this.userId = userId; 31 | } 32 | /** 33 | * @return the fullName 34 | */ 35 | public String getFullName() { 36 | return fullName; 37 | } 38 | /** 39 | * @param fullName the fullName to set 40 | */ 41 | public void setFullName(String fullName) { 42 | this.fullName = fullName; 43 | } 44 | /** 45 | * @return the adres 46 | */ 47 | public String getAdres() { 48 | return adres; 49 | } 50 | /** 51 | * @param adres the adres to set 52 | */ 53 | public void setAdres(String adres) { 54 | this.adres = adres; 55 | } 56 | /** 57 | * @return the age 58 | */ 59 | public int getAge() { 60 | return age; 61 | } 62 | /** 63 | * @param age the age to set 64 | */ 65 | public void setAge(int age) { 66 | this.age = age; 67 | } 68 | 69 | 70 | } 71 | -------------------------------------------------------------------------------- /week3/oop1/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "java.project.sourcePaths": ["src"], 3 | "java.project.outputPath": "bin", 4 | "java.project.referencedLibraries": [ 5 | "lib/**/*.jar" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /week3/oop1/bin/oop1/CorporateCustomer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/oop1/bin/oop1/CorporateCustomer.class -------------------------------------------------------------------------------- /week3/oop1/bin/oop1/Customer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/oop1/bin/oop1/Customer.class -------------------------------------------------------------------------------- /week3/oop1/bin/oop1/IndividualCustomer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/oop1/bin/oop1/IndividualCustomer.class -------------------------------------------------------------------------------- /week3/oop1/bin/oop1/Main.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/oop1/bin/oop1/Main.class -------------------------------------------------------------------------------- /week3/oop1/bin/oop1/Product.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/oop1/bin/oop1/Product.class -------------------------------------------------------------------------------- /week3/oop1/src/oop1/CorporateCustomer.java: -------------------------------------------------------------------------------- 1 | package oop1; 2 | 3 | public class CorporateCustomer extends Customer { 4 | private String companyName; 5 | private String taxNumber; 6 | /** diger classtan veri aldık customer 7 | * @return the companyName 8 | */ 9 | public String getCompanyName() { 10 | return companyName; 11 | } 12 | /** 13 | * @param companyName the companyName to set 14 | */ 15 | public void setCompanyName(String companyName) { 16 | this.companyName = companyName; 17 | } 18 | /** 19 | * @return the taxNumber 20 | */ 21 | public String getTaxNumber() { 22 | return taxNumber; 23 | } 24 | /** 25 | * @param taxNumber the taxNumber to set 26 | */ 27 | public void setTaxNumber(String taxNumber) { 28 | this.taxNumber = taxNumber; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /week3/oop1/src/oop1/Customer.java: -------------------------------------------------------------------------------- 1 | package oop1; 2 | 3 | public class Customer { 4 | private int id; 5 | private String customerNumber; 6 | private String phone; 7 | /** source>generate get and set ile hızlı şekilde tanımayabilirsiniz. 8 | * @return the id 9 | */ 10 | public int getId() { 11 | return id; 12 | } 13 | /** 14 | * @param id the id to set 15 | */ 16 | public void setId(int id) { 17 | this.id = id; 18 | } 19 | /** 20 | * @return the customerNumber 21 | */ 22 | public String getCustomerNumber() { 23 | return customerNumber; 24 | } 25 | /** 26 | * @param customerNumber the customerNumber to set 27 | */ 28 | public void setCustomerNumber(String customerNumber) { 29 | this.customerNumber = customerNumber; 30 | } 31 | /** 32 | * @return the phone 33 | */ 34 | public String getPhone() { 35 | return phone; 36 | } 37 | /** 38 | * @param phone the phone to set 39 | */ 40 | public void setPhone(String phone) { 41 | this.phone = phone; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /week3/oop1/src/oop1/IndividualCustomer.java: -------------------------------------------------------------------------------- 1 | package oop1; 2 | 3 | public class IndividualCustomer extends Customer { 4 | private String firstName; 5 | private String lastName; 6 | /** diğer classtan veri aldık customer 7 | * @return the firstName 8 | */ 9 | public String getFirstName() { 10 | return firstName; 11 | } 12 | /** 13 | * @param firstName the firstName to set 14 | */ 15 | public void setFirstName(String firstName) { 16 | this.firstName = firstName; 17 | } 18 | /** 19 | * @return the lastName 20 | */ 21 | public String getLastName() { 22 | return lastName; 23 | } 24 | /** 25 | * @param lastName the lastName to set 26 | */ 27 | public void setLastName(String lastName) { 28 | this.lastName = lastName; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /week3/oop1/src/oop1/Main.java: -------------------------------------------------------------------------------- 1 | 2 | package oop1; 3 | public class Main { 4 | public static void main(String[] args){ 5 | String mesaj = "Vade oranı"; 6 | 7 | Product product1 = new Product(); 8 | /*source>generate get and set ile hızlı şekilde tanımayabilirsiniz.*/ 9 | product1.setName("Delgi Kahve Makinesi"); 10 | product1.setDiscount(7); 11 | product1.setUnitPrice(7500); 12 | product1.setUnitsInStock(3); 13 | product1.setImageUrl("image.jpg"); 14 | 15 | Product product2 = new Product(); 16 | 17 | product2.setName("Legedi Kahve Makinesi"); 18 | product2.setDiscount(3); 19 | product2.setUnitPrice(5000); 20 | product2.setUnitsInStock(35); 21 | product2.setImageUrl("imaege.jpg"); 22 | 23 | Product product3 = new Product(); 24 | product3.setName("Dedo Kahve Makinesi"); 25 | product3.setDiscount(7); 26 | product3.setUnitPrice(700); 27 | product3.setUnitsInStock(6); 28 | product3.setImageUrl("imagee.jpg"); 29 | 30 | 31 | Product[] products = {product1, product2, product3}; 32 | 33 | //"for" sırayla productları gezer 1,2,3 34 | for (Product product : products) { 35 | System.out.println(product.getName()); 36 | } 37 | IndividualCustomer individualCustomer = new IndividualCustomer (); 38 | individualCustomer.setId(1); 39 | individualCustomer.setPhone("053252353"); 40 | individualCustomer.setCustomerNumber("12345"); 41 | individualCustomer.setFirstName("firstName"); 42 | individualCustomer.setLastName("lastName"); 43 | 44 | CorporateCustomer corporateCustomer = new CorporateCustomer(); 45 | corporateCustomer.setId(2); 46 | corporateCustomer.setPhone("phone"); 47 | corporateCustomer.setCustomerNumber("cust"); 48 | corporateCustomer.setCompanyName("name"); 49 | corporateCustomer.setTaxNumber("taxNumber"); 50 | 51 | Customer[] customers = {individualCustomer, corporateCustomer}; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /week3/oop1/src/oop1/Product.java: -------------------------------------------------------------------------------- 1 | package oop1; 2 | 3 | public class Product { 4 | String name; 5 | double unitPrice; 6 | double discount; 7 | String imageUrl; 8 | int unitsInStock; 9 | /**source>generate get and set ile hızlı şekilde tanımayabilirsiniz. 10 | * @return the name 11 | */ 12 | public String getName() { 13 | return name; 14 | } 15 | /** 16 | * @param name the name to set 17 | */ 18 | public void setName(String name) { 19 | this.name = name; 20 | } 21 | /** 22 | * @return the unitPrice 23 | */ 24 | public double getUnitPrice() { 25 | return unitPrice; 26 | } 27 | /** 28 | * @param unitPrice the unitPrice to set 29 | */ 30 | public void setUnitPrice(double unitPrice) { 31 | this.unitPrice = unitPrice; 32 | } 33 | /** 34 | * @return the discount 35 | */ 36 | public double getDiscount() { 37 | return discount; 38 | } 39 | /** 40 | * @param discount the discount to set 41 | */ 42 | public void setDiscount(double discount) { 43 | this.discount = discount; 44 | } 45 | /** 46 | * @return the imageUrl 47 | */ 48 | public String getImageUrl() { 49 | return imageUrl; 50 | } 51 | /** 52 | * @param imageUrl the imageUrl to set 53 | */ 54 | public void setImageUrl(String imageUrl) { 55 | this.imageUrl = imageUrl; 56 | } 57 | /** 58 | * @return the unitsInStock 59 | */ 60 | public int getUnitsInStock() { 61 | return unitsInStock; 62 | } 63 | /** 64 | * @param unitsInStock the unitsInStock to set 65 | */ 66 | public void setUnitsInStock(int unitsInStock) { 67 | this.unitsInStock = unitsInStock; 68 | } 69 | } -------------------------------------------------------------------------------- /week3/oopWithNLayeredApp/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "java", 9 | "name": "Launch Current File", 10 | "request": "launch", 11 | "mainClass": "${file}" 12 | }, 13 | { 14 | "type": "java", 15 | "name": "Launch Main", 16 | "request": "launch", 17 | "mainClass": "oopWithNLayeredApp.Main", 18 | "projectName": "oopWithNLayeredApp_2b9036c6" 19 | } 20 | ] 21 | } -------------------------------------------------------------------------------- /week3/oopWithNLayeredApp/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "java.project.sourcePaths": ["src"], 3 | "java.project.outputPath": "bin", 4 | "java.project.referencedLibraries": [ 5 | "lib/**/*.jar" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /week3/oopWithNLayeredApp/bin/oopWithNLayeredApp/App.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/oopWithNLayeredApp/bin/oopWithNLayeredApp/App.class -------------------------------------------------------------------------------- /week3/oopWithNLayeredApp/bin/oopWithNLayeredApp/business/ProductManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/oopWithNLayeredApp/bin/oopWithNLayeredApp/business/ProductManager.class -------------------------------------------------------------------------------- /week3/oopWithNLayeredApp/bin/oopWithNLayeredApp/core/logging/DatabaseLogger.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/oopWithNLayeredApp/bin/oopWithNLayeredApp/core/logging/DatabaseLogger.class -------------------------------------------------------------------------------- /week3/oopWithNLayeredApp/bin/oopWithNLayeredApp/core/logging/FileLogger.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/oopWithNLayeredApp/bin/oopWithNLayeredApp/core/logging/FileLogger.class -------------------------------------------------------------------------------- /week3/oopWithNLayeredApp/bin/oopWithNLayeredApp/core/logging/Logger.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/oopWithNLayeredApp/bin/oopWithNLayeredApp/core/logging/Logger.class -------------------------------------------------------------------------------- /week3/oopWithNLayeredApp/bin/oopWithNLayeredApp/core/logging/MailLogger.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/oopWithNLayeredApp/bin/oopWithNLayeredApp/core/logging/MailLogger.class -------------------------------------------------------------------------------- /week3/oopWithNLayeredApp/bin/oopWithNLayeredApp/dataAccess/HibernateProductDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/oopWithNLayeredApp/bin/oopWithNLayeredApp/dataAccess/HibernateProductDao.class -------------------------------------------------------------------------------- /week3/oopWithNLayeredApp/bin/oopWithNLayeredApp/dataAccess/JdbcProductDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/oopWithNLayeredApp/bin/oopWithNLayeredApp/dataAccess/JdbcProductDao.class -------------------------------------------------------------------------------- /week3/oopWithNLayeredApp/bin/oopWithNLayeredApp/dataAccess/ProductDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/oopWithNLayeredApp/bin/oopWithNLayeredApp/dataAccess/ProductDao.class -------------------------------------------------------------------------------- /week3/oopWithNLayeredApp/bin/oopWithNLayeredApp/entities/Product.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/oopWithNLayeredApp/bin/oopWithNLayeredApp/entities/Product.class -------------------------------------------------------------------------------- /week3/oopWithNLayeredApp/src/oopWithNLayeredApp/App.java: -------------------------------------------------------------------------------- 1 | package oopWithNLayeredApp; 2 | 3 | import oopWithNLayeredApp.business.ProductManager; 4 | import oopWithNLayeredApp.core.logging.DatabaseLogger; 5 | import oopWithNLayeredApp.core.logging.FileLogger; 6 | import oopWithNLayeredApp.core.logging.Logger; 7 | import oopWithNLayeredApp.core.logging.MailLogger; 8 | import oopWithNLayeredApp.dataAccess.HibernateProductDao; 9 | import oopWithNLayeredApp.dataAccess.JdbcProductDao; 10 | import oopWithNLayeredApp.entities.Product; 11 | 12 | public class App { 13 | public static void main(String[] args) throws Exception { 14 | Product product1 = new Product(1, "Iphone XR", 10000); 15 | 16 | Logger[] loggers = {new DatabaseLogger(), new FileLogger(), new MailLogger()}; 17 | 18 | ProductManager productManager = new ProductManager(new HibernateProductDao(),loggers); 19 | productManager.add(product1); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /week3/oopWithNLayeredApp/src/oopWithNLayeredApp/business/ProductManager.java: -------------------------------------------------------------------------------- 1 | package oopWithNLayeredApp.business; 2 | 3 | import java.util.List; 4 | import java.util.jar.Attributes.Name; 5 | 6 | import oopWithNLayeredApp.core.logging.Logger; 7 | import oopWithNLayeredApp.dataAccess.HibernateProductDao; 8 | import oopWithNLayeredApp.dataAccess.JdbcProductDao; 9 | import oopWithNLayeredApp.dataAccess.ProductDao; 10 | import oopWithNLayeredApp.entities.Product; 11 | 12 | public class ProductManager { 13 | private ProductDao productDao; 14 | private List loggers; 15 | 16 | public ProductManager(ProductDao productDao, Logger[] loggers2) { 17 | this.productDao = productDao; 18 | this.loggers = loggers; 19 | 20 | } 21 | 22 | 23 | 24 | public void add(Product product) throws Exception{ 25 | 26 | if(product.getUnitPrice()<10){ 27 | throw new Exception("Ürün fiyatı 10 dan küçük olamaz."); 28 | 29 | } 30 | 31 | 32 | productDao.add(product); 33 | 34 | for (Logger logger : loggers) { 35 | logger.log(product.getName()); 36 | 37 | } 38 | 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /week3/oopWithNLayeredApp/src/oopWithNLayeredApp/core/logging/DatabaseLogger.java: -------------------------------------------------------------------------------- 1 | package oopWithNLayeredApp.core.logging; 2 | 3 | public class DatabaseLogger implements Logger { 4 | 5 | @Override 6 | public void log(String data) { 7 | System.out.println("Veritabanına loglandı: "+ data); 8 | 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /week3/oopWithNLayeredApp/src/oopWithNLayeredApp/core/logging/FileLogger.java: -------------------------------------------------------------------------------- 1 | package oopWithNLayeredApp.core.logging; 2 | 3 | public class FileLogger implements Logger { 4 | 5 | @Override 6 | public void log(String data) { 7 | System.out.println("Dosyaya loglandı: "+ data); 8 | 9 | } 10 | 11 | 12 | 13 | } 14 | -------------------------------------------------------------------------------- /week3/oopWithNLayeredApp/src/oopWithNLayeredApp/core/logging/Logger.java: -------------------------------------------------------------------------------- 1 | package oopWithNLayeredApp.core.logging; 2 | 3 | public interface Logger { 4 | void log(String data); 5 | 6 | 7 | } 8 | -------------------------------------------------------------------------------- /week3/oopWithNLayeredApp/src/oopWithNLayeredApp/core/logging/MailLogger.java: -------------------------------------------------------------------------------- 1 | package oopWithNLayeredApp.core.logging; 2 | 3 | public class MailLogger implements Logger{ 4 | 5 | @Override 6 | public void log(String data) { 7 | System.out.println("Mail gonderildi: "+ data); 8 | 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /week3/oopWithNLayeredApp/src/oopWithNLayeredApp/dataAccess/HibernateProductDao.java: -------------------------------------------------------------------------------- 1 | package oopWithNLayeredApp.dataAccess; 2 | 3 | import oopWithNLayeredApp.entities.Product; 4 | 5 | public class HibernateProductDao implements ProductDao{ 6 | public void add(Product product){ 7 | System.out.println("Hibernate ile veritabanına eklendi."); 8 | } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /week3/oopWithNLayeredApp/src/oopWithNLayeredApp/dataAccess/JdbcProductDao.java: -------------------------------------------------------------------------------- 1 | package oopWithNLayeredApp.dataAccess; 2 | 3 | import oopWithNLayeredApp.entities.Product; 4 | 5 | public class JdbcProductDao implements ProductDao { 6 | public void add(Product product){ 7 | System.out.println("JDBC ile veritabanına eklendi."); 8 | } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /week3/oopWithNLayeredApp/src/oopWithNLayeredApp/dataAccess/ProductDao.java: -------------------------------------------------------------------------------- 1 | package oopWithNLayeredApp.dataAccess; 2 | 3 | import oopWithNLayeredApp.entities.Product; 4 | 5 | public interface ProductDao { 6 | void add(Product product); 7 | 8 | } 9 | -------------------------------------------------------------------------------- /week3/oopWithNLayeredApp/src/oopWithNLayeredApp/entities/Product.java: -------------------------------------------------------------------------------- 1 | package oopWithNLayeredApp.entities; 2 | 3 | public class Product { 4 | private int id; 5 | private String name; 6 | private double unitPrice; 7 | /** 8 | * 9 | */ 10 | public Product() { 11 | super(); 12 | } 13 | /** 14 | * @param id 15 | * @param name 16 | * @param unitPrice 17 | */ 18 | public Product(int id, String name, double unitPrice) { 19 | this.id = id; 20 | this.name = name; 21 | this.unitPrice = unitPrice; 22 | } 23 | /** 24 | * @return the id 25 | */ 26 | public int getId() { 27 | return id; 28 | } 29 | /** 30 | * @param id the id to set 31 | */ 32 | public void setId(int id) { 33 | this.id = id; 34 | } 35 | /** 36 | * @return the name 37 | */ 38 | public String getName() { 39 | return name; 40 | } 41 | /** 42 | * @param name the name to set 43 | */ 44 | public void setName(String name) { 45 | this.name = name; 46 | } 47 | /** 48 | * @return the unitPrice 49 | */ 50 | public double getUnitPrice() { 51 | return unitPrice; 52 | } 53 | /** 54 | * @param unitPrice the unitPrice to set 55 | */ 56 | public void setUnitPrice(double unitPrice) { 57 | this.unitPrice = unitPrice; 58 | } 59 | 60 | 61 | } 62 | -------------------------------------------------------------------------------- /week3/overriding/bin/App.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/overriding/bin/App.class -------------------------------------------------------------------------------- /week3/overriding/bin/BaseKrediManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/overriding/bin/BaseKrediManager.class -------------------------------------------------------------------------------- /week3/overriding/bin/OgrenciKrediManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/overriding/bin/OgrenciKrediManager.class -------------------------------------------------------------------------------- /week3/overriding/bin/OgretmenKrediManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/overriding/bin/OgretmenKrediManager.class -------------------------------------------------------------------------------- /week3/overriding/bin/TarimKrediManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/overriding/bin/TarimKrediManager.class -------------------------------------------------------------------------------- /week3/overriding/src/App.java: -------------------------------------------------------------------------------- 1 | public class App { 2 | public static void main(String[] args) throws Exception { 3 | BaseKrediManager[] krediManagers = new BaseKrediManager[] 4 | {new OgretmenKrediManager(), new TarimKrediManager(), new OgrenciKrediManager()}; 5 | 6 | for(BaseKrediManager krediManager :krediManagers){ 7 | System.out.println(krediManager.hesapla(1000)); 8 | 9 | } 10 | 11 | 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /week3/overriding/src/BaseKrediManager.java: -------------------------------------------------------------------------------- 1 | public class BaseKrediManager { 2 | public /*"final" kullanırsak override engellenir*/ double hesapla(double tutar){ 3 | return tutar * 1.18; 4 | 5 | } 6 | 7 | } 8 | -------------------------------------------------------------------------------- /week3/overriding/src/OgrenciKrediManager.java: -------------------------------------------------------------------------------- 1 | public class OgrenciKrediManager extends BaseKrediManager { 2 | @Override 3 | public double hesapla(double tutar){ 4 | return tutar * 1.10; 5 | 6 | } 7 | 8 | } 9 | -------------------------------------------------------------------------------- /week3/overriding/src/OgretmenKrediManager.java: -------------------------------------------------------------------------------- 1 | public class OgretmenKrediManager extends BaseKrediManager { 2 | 3 | 4 | } 5 | -------------------------------------------------------------------------------- /week3/overriding/src/TarimKrediManager.java: -------------------------------------------------------------------------------- 1 | public class TarimKrediManager extends BaseKrediManager { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /week3/polymorphismDemo/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "java.project.sourcePaths": ["src"], 3 | "java.project.outputPath": "bin", 4 | "java.project.referencedLibraries": [ 5 | "lib/**/*.jar" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /week3/polymorphismDemo/bin/App.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/polymorphismDemo/bin/App.class -------------------------------------------------------------------------------- /week3/polymorphismDemo/bin/BaseLogger.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/polymorphismDemo/bin/BaseLogger.class -------------------------------------------------------------------------------- /week3/polymorphismDemo/bin/ConsoleLogger.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/polymorphismDemo/bin/ConsoleLogger.class -------------------------------------------------------------------------------- /week3/polymorphismDemo/bin/CustomerManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/polymorphismDemo/bin/CustomerManager.class -------------------------------------------------------------------------------- /week3/polymorphismDemo/bin/DatabaseLogger.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/polymorphismDemo/bin/DatabaseLogger.class -------------------------------------------------------------------------------- /week3/polymorphismDemo/bin/EmailLogger.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/polymorphismDemo/bin/EmailLogger.class -------------------------------------------------------------------------------- /week3/polymorphismDemo/bin/FileLogger.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/polymorphismDemo/bin/FileLogger.class -------------------------------------------------------------------------------- /week3/polymorphismDemo/src/App.java: -------------------------------------------------------------------------------- 1 | import java.lang.System.Logger; 2 | 3 | public class App { 4 | public static void main(String[] args) throws Exception { 5 | /* BaseLogger[] loggers = new BaseLogger[]{new DatabaseLogger(), new EmailLogger(), new FileLogger(), new ConsoleLogger()}; 6 | for(BaseLogger logger:loggers){ 7 | logger.Log(" = Log mesajı"); 8 | } 9 | */ 10 | 11 | CustomerManager customerManager = new CustomerManager(new FileLogger()); 12 | customerManager.add(); 13 | 14 | 15 | 16 | 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /week3/polymorphismDemo/src/BaseLogger.java: -------------------------------------------------------------------------------- 1 | public class BaseLogger { 2 | public void log(String message){ 3 | System.out.println("Default logger : "+message); 4 | 5 | } 6 | 7 | } 8 | -------------------------------------------------------------------------------- /week3/polymorphismDemo/src/ConsoleLogger.java: -------------------------------------------------------------------------------- 1 | public class ConsoleLogger extends BaseLogger { 2 | public void log(String message){ 3 | System.out.println("Logged to console"+message); 4 | 5 | } 6 | 7 | } 8 | -------------------------------------------------------------------------------- /week3/polymorphismDemo/src/CustomerManager.java: -------------------------------------------------------------------------------- 1 | import javax.xml.crypto.Data; 2 | 3 | public class CustomerManager { 4 | private BaseLogger logger; 5 | 6 | public CustomerManager(BaseLogger logger){ 7 | this.logger = logger; 8 | 9 | } 10 | 11 | public void add(){ 12 | System.out.println("Müşteri eklendi"); 13 | this.logger.log(" : Log mesajı"); 14 | 15 | } 16 | 17 | 18 | } 19 | -------------------------------------------------------------------------------- /week3/polymorphismDemo/src/DatabaseLogger.java: -------------------------------------------------------------------------------- 1 | public class DatabaseLogger extends BaseLogger{ 2 | @Override 3 | public void log(String message){ 4 | System.out.println("Logged to database"+message); 5 | 6 | } 7 | 8 | } 9 | -------------------------------------------------------------------------------- /week3/polymorphismDemo/src/EmailLogger.java: -------------------------------------------------------------------------------- 1 | public class EmailLogger extends BaseLogger{ 2 | @Override 3 | public void log(String message){ 4 | System.out.println("Logged to email"+message); 5 | 6 | } 7 | 8 | } 9 | -------------------------------------------------------------------------------- /week3/polymorphismDemo/src/FileLogger.java: -------------------------------------------------------------------------------- 1 | public class FileLogger extends BaseLogger{ 2 | @Override 3 | public void log(String message){ 4 | System.out.println("Logged to file"+message); 5 | 6 | } 7 | 8 | } 9 | -------------------------------------------------------------------------------- /week3/staticDemo/bin/App.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/staticDemo/bin/App.class -------------------------------------------------------------------------------- /week3/staticDemo/bin/DatabaseHelper$Connection.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/staticDemo/bin/DatabaseHelper$Connection.class -------------------------------------------------------------------------------- /week3/staticDemo/bin/DatabaseHelper$Crud.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/staticDemo/bin/DatabaseHelper$Crud.class -------------------------------------------------------------------------------- /week3/staticDemo/bin/DatabaseHelper.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/staticDemo/bin/DatabaseHelper.class -------------------------------------------------------------------------------- /week3/staticDemo/bin/Product.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/staticDemo/bin/Product.class -------------------------------------------------------------------------------- /week3/staticDemo/bin/ProductManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/staticDemo/bin/ProductManager.class -------------------------------------------------------------------------------- /week3/staticDemo/bin/ProductValidator.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/staticDemo/bin/ProductValidator.class -------------------------------------------------------------------------------- /week3/staticDemo/src/App.java: -------------------------------------------------------------------------------- 1 | public class App { 2 | public static void main(String[] args) throws Exception { 3 | ProductManager manager = new ProductManager(); 4 | Product product = new Product(); 5 | product.price = 10; 6 | product.name = "Mouse"; 7 | 8 | manager.add(product); 9 | 10 | 11 | DatabaseHelper.Crud.Delete(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /week3/staticDemo/src/DatabaseHelper.java: -------------------------------------------------------------------------------- 1 | public class DatabaseHelper { 2 | public static class Crud{ //Create read update delete 3 | public static void Delete(){ 4 | 5 | } 6 | public static void Update(){ 7 | 8 | } 9 | } 10 | public static class Connection{ 11 | public static void createConnection(){ 12 | 13 | } 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /week3/staticDemo/src/Product.java: -------------------------------------------------------------------------------- 1 | public class Product { 2 | int id; 3 | String name; 4 | double price; 5 | 6 | } 7 | -------------------------------------------------------------------------------- /week3/staticDemo/src/ProductManager.java: -------------------------------------------------------------------------------- 1 | public class ProductManager { 2 | public void add(Product product){ 3 | ProductValidator validator = new ProductValidator(); 4 | if(validator.isValid(product)){ 5 | System.out.println("Eklendi"); 6 | }else{ 7 | System.out.println("Ürün bilgileri geçersizdir"); 8 | } 9 | 10 | 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /week3/staticDemo/src/ProductValidator.java: -------------------------------------------------------------------------------- 1 | public class ProductValidator { 2 | 3 | static{ 4 | System.out.println("Statik yapıcı blok çalıştı"); 5 | } 6 | 7 | public ProductValidator(){ 8 | System.out.println("XXX"); 9 | } 10 | 11 | public static boolean isValid(Product product){ 12 | if(product.price>0 && !product.name.isEmpty()){ 13 | return true; 14 | 15 | }else{ 16 | return false; 17 | } 18 | 19 | } 20 | public void bisey(){ 21 | 22 | } 23 | 24 | 25 | } 26 | 27 | //inner class -------------------------------------------------------------------------------- /week3/ytDemo/bin/App.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/ytDemo/bin/App.class -------------------------------------------------------------------------------- /week3/ytDemo/bin/BaseCreditManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/ytDemo/bin/BaseCreditManager.class -------------------------------------------------------------------------------- /week3/ytDemo/bin/CarCreditManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/ytDemo/bin/CarCreditManager.class -------------------------------------------------------------------------------- /week3/ytDemo/bin/Company.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/ytDemo/bin/Company.class -------------------------------------------------------------------------------- /week3/ytDemo/bin/CreditManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/ytDemo/bin/CreditManager.class -------------------------------------------------------------------------------- /week3/ytDemo/bin/Customer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/ytDemo/bin/Customer.class -------------------------------------------------------------------------------- /week3/ytDemo/bin/CustomerManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/ytDemo/bin/CustomerManager.class -------------------------------------------------------------------------------- /week3/ytDemo/bin/MilitaryCreditManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/ytDemo/bin/MilitaryCreditManager.class -------------------------------------------------------------------------------- /week3/ytDemo/bin/Person.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/ytDemo/bin/Person.class -------------------------------------------------------------------------------- /week3/ytDemo/bin/TeacherCreditManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/ytDemo/bin/TeacherCreditManager.class -------------------------------------------------------------------------------- /week3/ytDemo/bin/iCreditManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/ytDemo/bin/iCreditManager.class -------------------------------------------------------------------------------- /week3/ytDemo/bin/main2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/ytDemo/bin/main2.class -------------------------------------------------------------------------------- /week3/ytDemo/src/App.java: -------------------------------------------------------------------------------- 1 | public class App { 2 | public static void main(String[] args) throws Exception { 3 | CustomerManager customerManager = new CustomerManager(new Customer(), new TeacherCreditManager()); 4 | customerManager.GiveCredit(); 5 | TeacherCreditManager teacherCreditManager = new TeacherCreditManager(); 6 | teacherCreditManager.save(); 7 | 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /week3/ytDemo/src/BaseCreditManager.java: -------------------------------------------------------------------------------- 1 | public abstract class BaseCreditManager implements iCreditManager { 2 | 3 | 4 | public abstract void calculate(); 5 | 6 | @Override 7 | public void save() { 8 | System.out.println("Kaydedildi."); 9 | } 10 | 11 | 12 | } 13 | -------------------------------------------------------------------------------- /week3/ytDemo/src/CarCreditManager.java: -------------------------------------------------------------------------------- 1 | public class CarCreditManager extends BaseCreditManager implements iCreditManager { 2 | 3 | @Override 4 | public void calculate() { 5 | // TODO Auto-generated method stub 6 | System.out.println("Araba kredisi hesaplandı."); 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /week3/ytDemo/src/Company.java: -------------------------------------------------------------------------------- 1 | public class Company extends Customer { 2 | 3 | public String taxNumber; 4 | public String companyName; 5 | /** 6 | * @return the taxNumber 7 | */ 8 | public String getTaxNumber() { 9 | return taxNumber; 10 | } 11 | /** 12 | * @param taxNumber the taxNumber to set 13 | */ 14 | public void setTaxNumber(String taxNumber) { 15 | this.taxNumber = taxNumber; 16 | } 17 | /** 18 | * @return the companyName 19 | */ 20 | public String getCompanyName() { 21 | return companyName; 22 | } 23 | /** 24 | * @param companyName the companyName to set 25 | */ 26 | public void setCompanyName(String companyName) { 27 | this.companyName = companyName; 28 | } 29 | 30 | 31 | 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /week3/ytDemo/src/CreditManager.java: -------------------------------------------------------------------------------- 1 | public class CreditManager { 2 | 3 | public void Calculate(){ 4 | System.out.println("Hesaplandı"); 5 | 6 | } 7 | 8 | public void Save(){ 9 | System.out.println("Kredi verildi"); 10 | } 11 | 12 | public void Save(int id, String lastName, String firstName, String nationalIdentity, String city){ 13 | System.out.println("Müşteri kaydedildi"); 14 | } 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | } 23 | -------------------------------------------------------------------------------- /week3/ytDemo/src/Customer.java: -------------------------------------------------------------------------------- 1 | public class Customer { 2 | 3 | 4 | public int id; 5 | public String firstName; 6 | public String lastName; 7 | public String city; 8 | /** 9 | * @return the id 10 | */ 11 | public int getId() { 12 | return id; 13 | } 14 | /** 15 | * @param id the id to set 16 | */ 17 | public void setId(int id) { 18 | this.id = id; 19 | } 20 | /** 21 | * @return the firstName 22 | */ 23 | public String getFirstName() { 24 | return firstName; 25 | } 26 | /** 27 | * @param firstName the firstName to set 28 | */ 29 | public void setFirstName(String firstName) { 30 | this.firstName = firstName; 31 | } 32 | /** 33 | * @return the lastName 34 | */ 35 | public String getLastName() { 36 | return lastName; 37 | } 38 | /** 39 | * @param lastName the lastName to set 40 | */ 41 | public void setLastName(String lastName) { 42 | this.lastName = lastName; 43 | } 44 | /** 45 | * @return the city 46 | */ 47 | public String getCity() { 48 | return city; 49 | } 50 | /** 51 | * @param city the city to set 52 | */ 53 | public void setCity(String city) { 54 | this.city = city; 55 | } 56 | 57 | 58 | 59 | 60 | 61 | } 62 | 63 | -------------------------------------------------------------------------------- /week3/ytDemo/src/CustomerManager.java: -------------------------------------------------------------------------------- 1 | public class CustomerManager extends App { 2 | private Customer _customer; 3 | private iCreditManager _creditManager; 4 | public CustomerManager(Customer customer, iCreditManager creditManager){ 5 | _customer = customer; 6 | _creditManager = creditManager; 7 | } 8 | 9 | public void Save(){ 10 | System.out.println("Müşteri kaydedildi2 : "); 11 | } 12 | public void Delete(){ 13 | System.out.println("Müşteri Silindi : "); 14 | } 15 | public void GiveCredit(){ 16 | _creditManager.calculate(); 17 | System.out.println("Kredi verildi"); 18 | 19 | } 20 | 21 | 22 | 23 | } 24 | -------------------------------------------------------------------------------- /week3/ytDemo/src/MilitaryCreditManager.java: -------------------------------------------------------------------------------- 1 | import javax.swing.plaf.synth.SynthScrollBarUI; 2 | 3 | public class MilitaryCreditManager extends BaseCreditManager implements iCreditManager { 4 | 5 | @Override 6 | public void calculate() { 7 | System.out.println("Asker kredisi hesaplandı"); 8 | 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /week3/ytDemo/src/Person.java: -------------------------------------------------------------------------------- 1 | import javax.sql.rowset.spi.SyncResolver; 2 | 3 | public class Person extends Customer { 4 | 5 | public String nationalIdentity; 6 | 7 | /** 8 | * @return the nationalIdentity 9 | */ 10 | public String getNationalIdentity() { 11 | return nationalIdentity; 12 | } 13 | 14 | /** 15 | * @param nationalIdentity the nationalIdentity to set 16 | */ 17 | public void setNationalIdentity(String nationalIdentity) { 18 | this.nationalIdentity = nationalIdentity; 19 | 20 | } 21 | 22 | 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /week3/ytDemo/src/TeacherCreditManager.java: -------------------------------------------------------------------------------- 1 | public class TeacherCreditManager extends BaseCreditManager implements iCreditManager { 2 | 3 | @Override 4 | public void calculate() { 5 | // TODO Auto-generated method stub 6 | 7 | } 8 | 9 | 10 | 11 | } 12 | -------------------------------------------------------------------------------- /week3/ytDemo/src/iCreditManager.java: -------------------------------------------------------------------------------- 1 | 2 | public interface iCreditManager { 3 | 4 | void calculate(); 5 | void save(); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /week3/ytDemo/src/main2.java: -------------------------------------------------------------------------------- 1 | public class main2 { 2 | 3 | public void Main(){ 4 | /* CreditManager creditManager = new CreditManager(); 5 | creditManager.Calculate(); 6 | creditManager.Save(); 7 | 8 | Customer customer = new Customer(); 9 | 10 | customer.setId(1); 11 | customer.setFirstName("Eren"); 12 | customer.setLastName("Solmaz"); 13 | customer.setCity("Kirklareli"); 14 | 15 | CustomerManager customerManager = new CustomerManager(customer); 16 | customerManager.Save(); 17 | customerManager.Delete(); 18 | 19 | CustomerManager customerManager2 = new CustomerManager(new Person()); 20 | Person person = new Person(); 21 | person.setFirstName("Ahmet"); 22 | person.setNationalIdentity("53"); 23 | person.setId(32); 24 | 25 | Customer c1 = new Customer(); 26 | Customer c2 = new Company(); 27 | Customer c3 = new Person(); 28 | */ 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /week3/ytEgitim/bin/App.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erensolmaz/Java-Camp/37d5a6ff7b970c00e1bc5b28cd76c2ac9693eb08/week3/ytEgitim/bin/App.class -------------------------------------------------------------------------------- /week3/ytEgitim/src/App.java: -------------------------------------------------------------------------------- 1 | public class App { 2 | public static void main(String[] args) throws Exception { 3 | 4 | 5 | 6 | int sayi1 = 10; 7 | int sayi2 = 20; 8 | sayi1 = sayi2; 9 | sayi2 = 100; 10 | 11 | System.out.println("Sayi 1: " + sayi1); 12 | 13 | int[] sayilar1 = {1,2,3}; 14 | int[] sayilar2 = {10,20,30}; 15 | sayilar1 = sayilar2; 16 | 17 | sayilar2[0]=1000; 18 | 19 | System.out.println("sayilar 1 : " + sayilar1[0]); 20 | 21 | } 22 | } 23 | --------------------------------------------------------------------------------