WHAT ARE METHODS AND HOW ARE THEY DEFINED?

Pushpendra Singh

Total Post:241

Points:1205
Posted by  Pushpendra Singh
Java 
 1401  View(s)
Ratings:
Rate this:
  1. Pushpendra Singh

    Post:241

    Points:1205
    What are methods and how are they defined?

              Methods are functions that operate on instances of classes in which they are defined. Objects can communicate with each other using methods and can call methods in other classes. Method definition has four parts. They are name of the method, type of object or primitive type the method returns, a list of parameters and the body of the method. A method’s signature is a combination of the first three parts mentioned above.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!