This page focuses on how to declare and implement methods for a class. The next page shows you how to declare your class's methods. You declare all of the methods that are a member of the class within the class body. Typically, you declare a class's methods after you declare its variables, although this is not required. The method declaration shown above is a very basic method declaration.
Methods have many other attributes such as parameters, access control, and so on.
Returning a Value from a Method Java requires that a method declare the data type of the value that it returns. If a method returns no value, it can be declared to return void . Complex types are comprised of multiple or complex values and, sometimes, the operations that can be performed on those values. Complex types include classes, interfaces, and arrays. Methods can return either values of simple data types or of complex data types.