Created
September 5, 2020 20:37
-
-
Save mrnirva/dc49ef6a2d6c8fa78c235379ec5aab2c to your computer and use it in GitHub Desktop.
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 | |
public static void main(String[] args) { | |
/* | |
public int sayi = 5; | |
Bu kullanımı yanlıştır hata verir, metot içerisinde | |
Metot içerisinde erişim belirleyici kullanılmaz | |
*/ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment