- Primeros pasos con PHP
- Funcionamiento de PHP
- El fichero php.ini
- Sintaxis
- Variables
- Operadores PHP
- Crear páginas dinámicas
- Paso de valores vía Query String
- Control de flujo
- Procesado condicional
- Trabajar con condiciones
- Bucles
- Arrays
- Arrays enumerados
- Arrays asociativos
- Arrays de dos dimensiones
- Funciones de manipulación de Arrays
Categoría: Sin categoría
Proyecto JPA
Propiedades y métodos de Collections
Tutorial wildcards
Ejemplos Iterator
Implementaciones Set y Map
https://docs.oracle.com/javase/tutorial/collections/implementations/set.html
https://docs.oracle.com/javase/tutorial/collections/implementations/map.html
http://beginnersbook.com/2013/12/hashset-class-in-java-with-example/
http://beginnersbook.com/2013/12/hashmap-in-java-with-example/
Ejemplos excepciones
http://dis.um.es/~bmoros/Tutorial/parte9/cap9-3.html
http://beginnersbook.com/2013/04/java-throws/
Métodos default y estáticos
http://www.genbetadev.com/java-j2ee/java-8-metodos-default
http://codecriticon.com/default-static-interfaces-jdk8/
Archivo Radio
/*
* This code is sample code, provided as-is, and we make no
* warranties as to its correctness or suitability for
* any purpose.
*
* We hope that it's useful to you. Enjoy.
* Copyright 2004-13 LearningPatterns Inc.
*/
/*
* Lab - Interfaces
*
* This class defines a Radio. It will implement Volume easily
*
*
* This class performs no data validation; however, it
* mutes/unmutes appropriately, i.e., can't mute a muted
* Radio
*/
package com.entertainment;
// TODO add in declaration for implementing Volume
public class Radio
{
// INSTANCE VARIABLES
private int volume; // the volume
// for muting behavior
private int oldVolume;
private boolean isMuted;
// CONSTRUCTORS
public Radio()
{
super();
}
public Radio(int volumeIn)
{
super();
this.setVolume(volumeIn);
}
// ACCESSOR METHODS
// from interface Volume
public void setVolume(int volumeIn)
{
// delegate to contained VolumeControl object
volume = volumeIn;
}
/* TODO - Uncomment this method so Radio will compile after implementing the interface
// from interface IVolume
public int getVolume()
{
return volume;
}
*/
// from interface IVolume
// BEHAVIORAL METHODS
public void mute()
{
if (!this.isMuted()) // not currently muted
{
// store current volume in oldVolume
oldVolume = volume;
// set volume to zero
this.setVolume(0);
}
else // currently muted
{
// restore volume from oldVolume value
this.setVolume(oldVolume);
}
// toggle muted flag
isMuted = !isMuted;
}
// from interface IVolume
public boolean isMuted()
{
// delegate to contained VolumeControl object
return isMuted;
}
// returns a string representation of this class instance
@Override
public String toString()
{
// this method uses the "ternary" (three terms) operator
// (expression ? true-value : false-value)
// it's just a very compact if-else statement
return "Radio: volume=" +
(!this.isMuted() ? String.valueOf(volume) : "<muted>");
}
}