05 Jun 2014
Method Overloading in Java
When two or more then two methods sharing same name within the same class, having different type of parameters or different number of parameters. This is known as method overloading.
public class MethodOverload { public static void main(String[] args) { System.out.println("The sum of 10 and 20 " + sum(10, 20)); System.out.println("The sum of 10.0 and 10.4 is " + sum(10.0, 10.4)); System.out.println("The sum of 3.0, 5.4, and 10.14 is " + sum(3.0, 5.4, 10.14)); } public static int sum(int num1, int num2) { return num1+num2; } public static double sum(double num1, double num2) { return num1+num2; } public static double sum(double num1, double num2, double num3) { return sum(sum(num1, num2), num3); } }
Ambiguous Invocation
It’s possible that there are two or more possible matches for a method invocation where compiler unable to determine the most specific choice. This is known as ambiguous invocation and cause compilation error.
public class AmbiguousMethod { public static void main(String[] args) { System.out.println("The sum of 10 and 20 " + sum(10, 20)); } public static int sum(int num1, double num2) { return num1+num2; } public static double sum(double num1, int num2) { return num1+num2; } }
Hello Web Admin, I noticed that your On-Page SEO is is missing a few factors, for one you do not use all three H tags in your post, also I notice that you are not using bold or italics properly in your SEO optimization. On-Page SEO means more now than ever since the new Google update: Panda. No longer are backlinks and simply pinging or sending out a RSS feed the key to getting Google PageRank or Alexa Rankings, You now NEED On-Page SEO. So what is good On-Page SEO?First your keyword must appear in the title.Then it must appear in the URL.You have to optimize your keyword and make sure that it has a nice keyword density of 3-5% in your article with relevant LSI (Latent Semantic Indexing). Then you should spread all H1,H2,H3 tags in your article.Your Keyword should appear in your first paragraph and in the last sentence of the page. You should have relevant usage of Bold and italics of your keyword.There should be one internal link to a page on your blog and you should have one image with an alt tag that has your keyword….wait there’s even more Now what if i told you there was a simple WordPress plugin that does all the On-Page SEO, and automatically for you? That’s right AUTOMATICALLY, just watch this 4minute video for more information at. Seo Plugin
Thank you for notice. We are in mind to start SEO shortly.
Hi there! Quick question that’s entirely off topic. Do you know how to make your site mobile friendly? My web site looks weird when browsing from my apple iphone. I’m trying to find a template or plugin that might be able to correct this problem. If you have any recommendations, please share. Thank you!|
sorry, i don’t know anyone. may be someone else will help you in this regard.
Superb blog you have here but I was wanting to know if you knew
of any community forums that cover the same
topics discussed in this article? I’d really love to be a part of
community where I can get responses from other knowledgeable people that share the same interest.
If you have any suggestions, please let me know. Kudos!
I just want to say I am just new to blogging and truly liked your blog. Almost certainly I’m going to bookmark your website . You certainly have excellent article content. Regards for sharing your website.
Excellent, what a web site it is! This web site gives valuable data to us, keep it up.