In Java there are 4 types of methods thouse are given below
1. No return type no parameters.
Syntax:
Void m1()
{
Statments;
}
2. No return type with parameter.
Syntax:
Void m1(int x)
{
Statments;
}
3. Return type no parameters.
Syntax:
Void m1()
{
Statments;
Return variable;
}
4. Return type with parameters.
Syntax:
Void m1()
{
Statments;
Return variable;
}
1. No return type no parameters.
Syntax:
Void m1()
{
Statments;
}
2. No return type with parameter.
Syntax:
Void m1(int x)
{
Statments;
}
3. Return type no parameters.
Syntax:
Void m1()
{
Statments;
Return variable;
}
4. Return type with parameters.
Syntax:
Void m1()
{
Statments;
Return variable;
}
No comments:
Post a Comment