Java

Javier Alvarez

What is Java?

Java is an object-oriented programming language

Why should you use Java?

You should use java because...

Simple

Solid

Portable

Reusable code

Java is based on

Classes

Objects

Methods

Classes

Java classes are templates for creating objects.

Objects

Entity existing in the memory of the computer that has specific available properties and operations (methods).

Methods

The methods are the actions performed by an object by means of an invocation

Example

class Persona{
    String nombre,apellido;
    int edad;
    public Persona(String nombre, String apellido, int edad) {
        this.nombre = nombre;
        this.apellido = apellido;
        this.edad = edad;
    }
    public String getApellido() {
        return apellido;
    }
    public void setApellido(String apellido) {
        this.apellido = apellido;
    }