Created
September 4, 2020 19:45
-
-
Save mrnirva/84aa5116e773b99ffb9d31fd8a35812d 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 metotlar; | |
public class Metotlar { | |
public static void main(String[] args) { | |
// Aynı isimle metotları çağırdık | |
// Tek fark parametresinin tipi | |
ekrandaGoster(12345); | |
ekrandaGoster("Merhaba Dünya"); | |
ekrandaGoster(15.9f); | |
ekrandaGoster(16.9d); | |
} | |
// Tam sayı ifadelerde bu metot çağırılacak | |
static void ekrandaGoster(int tamSayi){ | |
System.out.println(tamSayi); | |
} | |
// String ifadelerde bu metot çağırılacak | |
static void ekrandaGoster(String metin){ | |
System.out.println(metin); | |
} | |
// Ondalık (float) ifadelerde bu metot çağırılacak | |
static void ekrandaGoster(float ondalikliSayi){ | |
System.out.println(ondalikliSayi); | |
} | |
// Ondalık (double) ifadelerde bu metot çağırılacak | |
static void ekrandaGoster(double ondalikliSayi){ | |
System.out.println(ondalikliSayi); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment