0% found this document useful (0 votes)
14 views2 pages

Understanding Methods in OOP

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views2 pages

Understanding Methods in OOP

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

Method : It is group or block of code.

It reduces line of code.


It increases the readability of code.

Syntax : Access_Modifier returnType methodName(arguments/parameter){


-------------------
-------------------
}

Example :

package method;

public class MethodDemo {

public void welcome() {


[Link]("Welcome to BikkadIT");
}

public void greet() {


[Link]("Good evening all");
}

public static void main(String[] args) {

MethodDemo m = new MethodDemo();


[Link]();
[Link]();
}
}

package method;

public class MethodDemo {

public static void main(String[] args) {

[Link]("Welcome to BikkadIT");
[Link]("Welcome to BikkadIT");
[Link]("Welcome to BikkadIT");
[Link]("Welcome to BikkadIT");
[Link]("Welcome to BikkadIT");

[Link]("Welcome to BikkadIT");
[Link]("Welcome to BikkadIT");
[Link]("Welcome to BikkadIT");
[Link]("Welcome to BikkadIT");
[Link]("Welcome to BikkadIT");

[Link]("Welcome to BikkadIT");
[Link]("Welcome to BikkadIT");
[Link]("Welcome to BikkadIT");
[Link]("Welcome to BikkadIT");
[Link]("Welcome to BikkadIT");

[Link]("Welcome to BikkadIT");
[Link]("Welcome to BikkadIT");
[Link]("Welcome to BikkadIT");
[Link]("Welcome to BikkadIT");
[Link]("Welcome to BikkadIT");

[Link]("Welcome to BikkadIT");
[Link]("Welcome to BikkadIT");
[Link]("Welcome to BikkadIT");
[Link]("Welcome to BikkadIT");
[Link]("Welcome to BikkadIT");

Example :

package method;

public class MethodDemo {

public void welcome() {

[Link]("Welcome to BikkadIT");
[Link]("Welcome to BikkadIT");
[Link]("Welcome to BikkadIT");
[Link]("Welcome to BikkadIT");
[Link]("Welcome to BikkadIT");
}
public static void main(String[] args) {

MethodDemo m=new MethodDemo();


[Link]();
[Link]();
[Link]();
[Link]();
[Link]();

You might also like