Aşırı yükleme (Overloading), Nesne Yönelimli Programlamanın en önemli özelliklerinden birisidir. Aşırı yükleme (Overloading) sayesinde benzer işleri yapan bir çok metot yerine bir metot kullanılır. Metotların detaylı anlatımı için Java Dili Metotlar sayfasını ziyaret edebilirsiniz.
Java programlama dilinde her bir metot farklı işlemler yapar ve her bir metodun ismi olur. Fakat farklı işlemler yapan ama aynı isme sahip olan metotlar oluşturmak istediğimizde bu işlemi aşırı yükleme(Overloading) ile yapıyoruz.
Örneğin topla() adında bir metodun 2 tane parametresi olsun ve metoda gönderilen sayıları toplayıp ekrana yazdırsın.
Kullanıcı bu metoda 3 tane sayı gönderdiği zaman program hata verecektir. Fakat biz topla() adında 3 parametreli farklı bir metot oluşturabiliriz. Bu şekilde kullanıcı topla() metoduna 3 adet sayı gönderdiği zaman da bu metodu kullanarak işlem yapacaktır.
Bu örneği programımızın üzerinde çalıştıralım:
package kodbloklari.com;
public class Overloading1 {
static void topla(int sayi1,int sayi2) {
System.out.println("Toplam = " + (sayi1 + sayi2));
}
public static void main(String[] args) {
topla(5,10);
topla(5,10,6);
}
}
Burada sadece 2 parametre alan bir topla() adında metot oluşturduk.
Ana programda topla() metoduna 11. satırda 2 tane ve 12. satırda 3 tane sayı gönderdik. 2 sayı gönderdiğimiz metot çalışırken 3 sayı gönderdiğimiz metot çalışmadı.

Şimdi bu programa 3 parametre alan metodu da ekleyelim.
package kodbloklari.com;
public class Overloading2 {
static void topla(int sayi1, int sayi2) {
System.out.println("2 Sayının toplamı = " + (sayi1 + sayi2) );
}
static void topla(int sayi1, int sayi2, int sayi3) {
System.out.println("3 Sayının toplamı = " + (sayi1 + sayi2 + sayi3));
}
public static void main(String[] args) {
topla(5,10);
topla(2,8,10);
}
}
Yukarıda da topla() adını kullanarak 2 ve 3 parametre alan 2 farklı metot oluşturduk.
Kullanıcı 2 adet sayı gönderdiği zaman ilgili (2 adet parametre alan) metot, 3 adet sayı gönderdiği zamanda 3 adet parametre alan metot çalışıyor.
Kodun ekran çıktısı da şu şekildedir:

Metotlarda Overloading genel itibarıyla bu şekildedir.
Şimdi biraz daha farklı bir örnek yapalım.
package kodbloklari.com;
public class Overloading3 {
static void goster(int sayi1, int sayi2) {
System.out.println("1.Sayı = " + sayi1);
System.out.println("2.Sayı = " + sayi2);
}
static void goster(int sayi1,String isim) {
System.out.println("İsim = " + isim);
System.out.println("Sayı = " + sayi1);
}
public static void main(String[] args) {
goster(53,25);
goster(25,"KOD BLOKLARI");
}
}
Burada da gördüğünüz gibi metotların parametrelerinde farkı veri tipleri kullanabiliriz.
Kullanıcı 2 adet sayı girerse ilgili metodu, bir sayı ve bir ismi girerse de ilgili metodu çalıştırır.
Kodun ekran çıktısı da aşağıdaki şekildedir:

Birde Java’nın kendi yapısında Overloading işlemi uygulanmış metotları vardır. Bunlara örnek verelim.
ArrayList add() Metodu Overloading:
package kodbloklari.com;
import java.util.ArrayList;
public class Overloading4 {
public static void main(String[] args) {
ArrayList<String> liste = new ArrayList<String>();
liste.add("Hakan");
liste.add("Murat");
liste.add(1,"Gokcen");
}
}
Burada önce ArrayList kullanmamız için java.util paketini eklememiz gerekiyor. Daha sonra da listemize eleman eklemek için add() metodunu kullanmamız gerekiyor.
Yukarıdaki kod da gördüğünüz gibi add() metoduna Overloading işlemi uygulanmış.
Sadece elemanı girdiğimiz zaman direk sırasıyla eklerken, bir sayı ve eleman girdiğimiz zaman da gireceğimiz elemanın hangi indekse eklenmesi istediğimizi belirtiyoruz.
ArrayListlerin detaylı anlatımı için Java Dili ArrayList sayfasını ziyaret edebilirsiniz.
150 Yorum
Thanks, I have recently been searching for info approximately this subject for a while and yours is the greatest I’ve came upon till now. However, what about the conclusion? Are you certain about the supply?
Really enjoyed this article post.Really looking forward to read more. Great.
buy fenofibrate 200mg pills order fenofibrate sale order fenofibrate online cheap
Thank you for your blog post.Really thank you! Really Great.
buy cialis 5mg for sale viagra sildenafil buy viagra online
ketotifen over the counter order generic ketotifen 1 mg tofranil online order
minoxidil solution order cialis 10mg online cheap buy ed pills
pill precose 50mg order griseofulvin 250mg generic order fulvicin 250mg without prescription
Wonderful beat ! I wish to apprentice even as you amend your web site, how can i subscribe for a blog site? The account aided me a applicable deal. I were a little bit familiar of this your broadcast provided vivid clear concept
These are in fact enormous ideas in regarding blogging.You have touched some fastidious factors here. Any way keep upwrinting.
aspirin 75 mg tablet imiquad order online zovirax oral
dipyridamole 25mg oral order pravastatin 20mg generic pravachol 10mg cheap
I am so grateful for your blog. Great.
generic melatonin 3mg buy danocrine 100mg pills buy danazol without prescription
order dydrogesterone 10 mg without prescription buy cheap generic duphaston empagliflozin 25mg cost
fludrocortisone 100mcg usa order aciphex 20mg sale loperamide 2mg generic
purchase prasugrel for sale tolterodine cheap order tolterodine 1mg pills
monograph order order cilostazol 100 mg online cheap cheap pletal 100mg
buy generic ferrous sulfate 100 mg ascorbic acid 500 mg pill brand betapace 40mg
pyridostigmine cost order piroxicam 20mg sale order maxalt 10mg without prescription
order enalapril vasotec cost buy duphalac bottles
latanoprost usa exelon 3mg without prescription purchase rivastigmine pills
oral premarin 600 mg purchase dostinex generic sildenafil 100mg cost
omeprazole 20mg ca generic singulair lopressor over the counter
A round of applause for your blog post.Much thanks again. Really Great.
buy micardis without prescription purchase micardis generic order molnupiravir 200 mg online cheap
Muchos Gracias for your blog article.Really looking forward to read more. Much obliged.
cialis 20mg price oral tadalafil 10mg cheap sildenafil online
cenforce without prescription buy naproxen cheap oral aralen
Thank you for another fantastic article. The place else may just anybody get that type of info in such an ideal way of writing? I’ve a presentation next week, and I am at the look for such info.
I don’t even know how I ended up here, but I thought this post was good. I don’t know who you are but certainly you’re going to a famous ???? Cheers! wattpad.com
I really like reading through an article that will make people think. Also, thank you for allowing me to comment!
Hi, this weekend is fastidious in favor of me, as this pointin time i am reading this enormous educational posthere at my home.
buy generic omnicef over the counter buy generic cefdinir online prevacid where to buy
purchase absorica pills order azithromycin 250mg sale azithromycin 500mg cost
Say, you got a nice blog. Keep writing.
atorvastatin 40mg drug amlodipine 10mg brand buy norvasc 10mg generic
buy azipro generic azithromycin 250mg cost order neurontin pill
online roulette wheel buy lasix 100mg for sale furosemide 100mg for sale
buy pantoprazole 20mg sale lisinopril price pyridium 200 mg for sale
no deposit free spins casino acticlate buy online what to do when allergy medicine doesn’t work
I am so grateful for your post.Really thank you! Really Cool.
poker games real online casino ivermectin over the counter
Really appreciate you sharing this post.Really looking forward to read more. Much obliged.
amantadine over the counter oral symmetrel 100mg buy dapsone 100 mg pills
Enjoyed every bit of your post.Much thanks again. Will read on…
zielony platform buty hvit bohemian kjole amazon deuter schultertasche tuta nike a quadretti nike stefan janoski noir noir blanco air max 97 footlocker xanderafrica
online slots for real money augmentin 375mg ca order levothroid generic
Ahaa, its pleasant conversation on the topic of this post here at this blog, I have read all that, so now me also commenting at this place.
order clomiphene without prescription order imdur 20mg pill azathioprine online buy
medrol 16 mg tablets purchase triamcinolone generic aristocort 4mg generic
vardenafil 20mg oral tizanidine generic how to get zanaflex without a prescription
perindopril without prescription allegra 120mg pill buy fexofenadine 180mg
order dilantin 100mg generic purchase flexeril generic order ditropan
ozobax canada purchase toradol generic toradol 10mg cost
claritin order online order altace buy dapoxetine 90mg online
order baclofen generic buy ketorolac tablets buy toradol 10mg pill
alendronate pill alendronate uk purchase macrodantin pills
Really appreciate you sharing this post.Really looking forward to read more. Really Cool.
buy cheap generic propranolol order ibuprofen pills where to buy plavix without a prescription
Great, thanks for sharing this blog article.Much thanks again.
glimepiride uk glimepiride 1mg oral arcoxia 60mg over the counter
nortriptyline 25 mg pills where to buy methotrexate without a prescription buy anacin 500 mg generic
I am sure this post has touched all the internet users, its really really nice article on building up new blog.Visit my blog post; natural yeast infection treatment
xenical 60mg usa cheap orlistat 60mg diltiazem price
coumadin 5mg sale buy warfarin pills buy maxolon medication
I liked the article, Ill be back to read more of your blog later =)
Just where maybe you’ve discovered the supply for the purpose of this kind of post? Wonderful studying I have subscribed to your site feed.
famotidine us order tacrolimus 5mg online tacrolimus ca
purchase astelin sprayer buy azelastine 10 ml nasal spray avapro 300mg drug
brand esomeprazole order generic remeron 15mg topiramate pills
buy generic allopurinol 100mg temovate oral order crestor 20mg for sale
buy imitrex 50mg for sale cost imitrex avodart over the counter
Enjoyed every bit of your article post. Cool.
buspar price where to buy buspirone without a prescription amiodarone 100mg ca
order ranitidine 300mg online order celebrex 100mg without prescription order celecoxib 200mg generic
motilium cheap sumycin for sale online order tetracycline pills
Thanks so much for the post.Really looking forward to read more. Keep writing.
I truly appreciate this post.Thanks Again. Awesome.
Thanks for sharing, this is a fantastic post.Really thank you! Much obliged.
how to write an essay about my family help writing a paper help writing paper
Fantastic article.Really thank you! Will read on…
I really like and appreciate your blog article.Really looking forward to read more. Cool.
Great article.Much thanks again. Keep writing.
diflucan price cipro price brand cipro 1000mg
order sildenafil 100mg sildalis brand buy estradiol 1mg generic
I really liked your blog post.Really thank you! Keep writing.
I really liked your article.Really looking forward to read more. Much obliged.
Hey, thanks for the blog post.Thanks Again. Really Cool.
flagyl 400mg uk metronidazole 200mg over the counter keflex 125mg over the counter
lamictal 50mg cheap order lamotrigine 50mg online buy mebendazole generic
Thank you for your article.Much thanks again. Cool.
cleocin ca cleocin 150mg pills buy fildena generic
retin cream sale tretinoin gel uk buy cheap generic avana
Major thankies for the article.Much thanks again. Really Cool.
nolvadex medication buy budesonide without a prescription budesonide brand
Wow, great blog post.Thanks Again. Keep writing.
This post is really a good one it assists new internet users, who are wishing for blogging.
buy tadacip pills for sale generic indomethacin 75mg brand indocin 50mg
Thank you ever so for you blog.Much thanks again. Cool.
order axetil pill how to buy careprost robaxin 500mg pills
trazodone 100mg pills order suhagra generic order clindamycin
terbinafine 250mg us online card games casino online blackjack
Hey, thanks for the post. Want more.
generic aspirin 75 mg best online casino for real money poker online games
modafinil provigil modafinil generic – modalert online
I really like and appreciate your blog post.Thanks Again. Want more.
cheap essay help medicine essay writing suprax 100mg canada
Thanks so much for the blog.Much thanks again. Awesome.
Thank you for your article post.Really thank you! Want more.
buying essays essays online to buy free spins no deposit uk
I am so grateful for your post.Really looking forward to read more. Keep writing.
Fantastic article. Fantastic.
trimox 500mg usa macrobid us clarithromycin usa
Im thankful for the article post.Really thank you! Want more.
I loved your blog article. Cool.
I truly appreciate this blog post.Thanks Again. Really Cool.
buy generic rocaltrol tricor 200mg canada fenofibrate cost
Im thankful for the blog.Really thank you! Fantastic.
This blog was… how do you say it? Relevant!!Finally I have found something which helped me.Cheers!
Very neat blog post.Really looking forward to read more. Will read on…
Thanks for the article post.Thanks Again. Fantastic.
Hi there, yup this article is really good and I havelearned lot of things from it regarding blogging. thanks.
buy catapres 0.1mg sale antivert order tiotropium bromide 9mcg over the counter
I really like and appreciate your blog. Awesome.
Very good blog post.Really looking forward to read more. Keep writing.
acne treatment for teenage boys best acne treatment teenage guys trileptal canada
A big thank you for your blog article.Thanks Again. Much obliged.
buy minocycline terazosin canada order requip 1mg generic
uroxatral 10 mg usa order uroxatral 10mg pill how to eliminate heartburn
purchase femara online cheap order femara 2.5 mg sale abilify for sale online
what is the strongest sleeping pill most potent sleeping pills top 10 weight loss pills
Great article.Really thank you! Awesome.
I like the valuable information you provide in your articles. I’ll bookmark your blog and check again here frequently. I am quite sure I’ll learn plenty of new stuff right here! Good luck for the next!
Hi! Do you know if they make any plugins to help with SEO?I’m trying to get my blog to rank for some targetedkeywords but I’m not seeing very good success. If you know of any please share.Kudos!Feel free to visit my blog post :: pennystocks
Good replies in return of this question with firm arguments and describing everything regarding that.
buy provera 10mg for sale order biltricide pill hydrochlorothiazide 25 mg pill
smoking cessation prescription medication free stop smoking patches government pain medication online order
Im obliged for the article post.Much thanks again. Really Cool.
Fantastic blog.Thanks Again.
cytotec 200mcg tab – gncytotecp.com cytotec canada pharmacy
how are antiviral drugs used type 2 diabetes management nhs diabities medicine chart and compariaosn
buy periactin online luvox pill ketoconazole where to buy
Awesome article.Thanks Again.
A round of applause for your post.Thanks Again. Really Cool.
Thanks for sharing, this is a fantastic blog. Awesome.
fungus clear probiotics best antifungal pills list high blood pressure medications
purchase duloxetine online cheap buy glipizide 10mg without prescription generic modafinil 100mg
I am so grateful for your blog post. Much obliged.
I really like and appreciate your blog.Much thanks again. Will read on…