Skip to content

Commit 552f16f

Browse files
author
Necmiye Soylu
committed
.
1 parent 2483d69 commit 552f16f

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

genericMethod.class

1.07 KB
Binary file not shown.

genericMethod.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
public class genericMethod
2+
{
3+
public static void main(String[] Soylu)
4+
{
5+
char x='A';
6+
add(x);
7+
}
8+
static <T> void add(T t)
9+
{
10+
System.out.println("the element is "+ t);
11+
}
12+
13+
}
14+
//önce aynı isimli fakat farklı paremetre alan ve gönderilen paremetre listesinden hangi fonksiyonun bulunabildii kod yazdı şimdi ise
15+
//işi biraz daha abartıp overloded yapmaya gerek yok biz tipi belli olmayan fonksiyon yazalım dedik bunu bir örnke olarak sadadce boyle
16+
//bir şeytin var olduğunu b,lel,im diye koydum. Dha derin oop kısmında öğrenicez :))

overloadedMethod.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@ static void f(char c)
2323
}
2424
}
2525
// √overloading
26+
// java overloaded operator 'ü desteklemez'
2627
// overriding sadece aynı isim
2728
// tipsiz :))

0 commit comments

Comments
 (0)