Ad Home

Theme images by kelvinjay. Powered by Blogger.

Travel

Header Ads

Java

Selenium

UFT

Framework

General QA Concept

BDD

» » » What Is Method Signature In Java

Understanding method signature is an important aspect of java programing.

The rules are:

  • Method signature consists of name of the method and argument type.
public void method1(float f,int i,char ch)
it's method signature will be method1(float,int,char)
  • In java return type is not a part of method signature.Compiler will always use method signature while resolving method calls. In java in a same class two methods with the same signature not allowed. We will get compile time error.
Class TestTwoMethods{
public static void method1(String st)
{

}
public static void method1(int val)
{
//this is allowed
}
public static int method1(String st)
{

return 0;
//not allowed as both the methods method1 are having same signature 
}

}


«
Next
Newer Post
»
Previous
Older Post

2 comments:

  1. good brother u are introducing daily new topic of java .. thanks...please explain file input /output streams in detail... please

    ReplyDelete
  2. Hei Muzzammil thanks for your comment.. Sure I will start it very soon

    ReplyDelete