ClubEnsayos.com - Ensayos de Calidad, Tareas y Monografias
Buscar

La Cosa Redaccion


Enviado por   •  26 de Julio de 2012  •  448 Palabras (2 Páginas)  •  342 Visitas

Página 1 de 2

Objective:

- Handle the methods of a class in the Java language.

- Manipulate a method in an appropriate manner.

- Identify the different types of methods.

- Explain overloaded methods.

Procedure: First I open BlackBoard in my computer, then I go to the subject “Computer Science III” already there I go to my curses, and open the Module 4. Specific methods and algorithms next go to Topic 11. Development and use of methods, and there I used a report rubric, to make a report for the Topic 11 considering all important aspect and things of it.

Results:

Topic 11. Development and use of methods

As seen before, objects contain attributes and methods, in Java a method is a block of code defined inside a class and that describes the operations done by the method, such as: Calculating, storing, printing, etc.

11.1 Declaring and calling a method

A method is declared inside a class.

The next syntax is used:

[modifier] [data type that it returns] [method name] ( [arguments] ){

Instructions that the method will execute.

}

To call a method, once the variable that makes reference to the object of the class is initiated, you just need to write the name of the variable and the name of the method separated by a point.

11.2 Worker method and calling

All methods need to be called or invoked from some point of the program to be executed. Normally the calling is done from the main method, be it from the same class or from any other.

Advantage of Methods:

- Allows to divide the work of the program into different tasks.

- Facilitate the reading and maintenance of a program.

- Makes the development and maintenance of the code a lot easier.

• The worker method is also known as an execution method and it executes an action.

• The call method is a method that invokes or calls another method to execute an action.

11.3 Comparing object methods and statics

Now, you can define methods that make use of the "static" modifier which, unlike those who do not use it, can be called without having

...

Descargar como (para miembros actualizados)  txt (2.5 Kb)  
Leer 1 página más »
Disponible sólo en Clubensayos.com