This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package accessmodifiers; | |
// Ana sınıf public olarak nitelenir | |
public class ErisimBelirleyiciler { | |
// Bu şekilde erişim belirleyiciye sahip değişken oluşturabiliriz | |
// Buradaki public yani her yerden erişilebilir bir değişken | |
public int sayi = 5; | |
// Main metodu her zaman publictir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package scannerdersi; | |
import java.util.Scanner; | |
public class ScannerDersi { | |
public static void main(String[] args) { | |
// Scanner nesnesini oluşturmak | |
Scanner sc = new Scanner(System.in); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package scannerdersi; | |
import java.util.Scanner; | |
public class ScannerDersi { | |
public static void main(String[] args) { | |
// Scanner nesnesini oluşturmak | |
Scanner sc = new Scanner(System.in); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package scannerdersi; | |
import java.util.Scanner; | |
public class ScannerDersi { | |
public static void main(String[] args) { | |
// Scanner nesnesi oluşturma | |
// System.in kafanızı karıştırmasın |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package metotlar; | |
public class Metotlar { | |
public static void main(String[] args) { | |
// Aynı isimle metotları çağırdık | |
// Tek fark parametresinin tipi | |
ekrandaGoster(12345); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package metotlar; | |
public class Metotlar { | |
public static void main(String[] args) { | |
// Nesne Oluşturarak Metoda Erişmek | |
// Aşağıdaki karesiniAl metodumuz Metotlar isimli sınıfımızın bir üyesi | |
// Bu nedenle Metotlar sınıfıyla erişmemiz gerekiyor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package metotlar; | |
public class Metotlar { | |
public static void main(String[] args) { | |
// Parametre Alan ve Değer Döndüren Metot | |
System.out.println(karesiniAl(12)); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package metotlar; | |
public class Metotlar { | |
public static void main(String[] args) { | |
// Parametre Alan ve Değer Döndürmeyen Metot | |
// Metodu bu şekilde çağırırız | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package metotlar; | |
public class Metotlar { | |
public static void main(String[] args) { | |
// Parametre Almayan ve Değer Döndürmeyen Metot | |
// Metodu bu şekilde çağırırız | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package donguler; | |
public class Donguler { | |
public static void main(String[] args) { | |
// break Örneği | |
// Sayaç 5 olduğunda döngüyü bitirir | |