Skip to content

Instantly share code, notes, and snippets.

@mrnirva
Created September 4, 2020 19:11
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/4f6b5b5d5ee472bab9ff99a3de435144 to your computer and use it in GitHub Desktop.
Save mrnirva/4f6b5b5d5ee472bab9ff99a3de435144 to your computer and use it in GitHub Desktop.
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));
}
/*
Parametre olarak int tipinde sayi isimli değişken verdik
Geriye değer döndürme kısmında kareyi hesaplayıp
return ile döndürdük.
*/
static int karesiniAl(int sayi){
int karesi = sayi * sayi;
return karesi;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment