Fonksiyonlar Metodlar

Fonksiyon kavramı matematikteki  fonksiyon kavramı ile birebir aynıdır. f(X)=2x+4 şeklinde matematikteki gibi bir fonrksiyonumuz olsun.

fonksiyonlar

// f(x) = 2x + 4
static int f(int x){
return 2*x+4;
}
public static void main(String[] args) {
// TODO code application logic here
System.out.println(f(3));

}

run:
10
BUILD SUCCESSFUL (total time: 0 seconds)

 

Yorum bırakın