Skip to content

Instantly share code, notes, and snippets.

@mrnirva
Created September 5, 2020 20:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrnirva/dc49ef6a2d6c8fa78c235379ec5aab2c to your computer and use it in GitHub Desktop.
Save mrnirva/dc49ef6a2d6c8fa78c235379ec5aab2c to your computer and use it in GitHub Desktop.
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