elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Recuerda que debes registrarte en el foro para poder participar (preguntar y responder)


  Mostrar Temas
Páginas: [1]
1  Comunicaciones / Redes / Diferencia entre firewall y proxy en: 27 Agosto 2014, 19:45 pm
Buenas!

Me gustaría saber la diferencia entre un firewall y un proxy con mucho detalle. Estuve leyendo en internet pero hay muchas cosas que no me quedan claras ya que son explicaciones muy de andar por casa ...

Gracias de antemano.
2  Programación / Java / Problema con el inicio del programa en: 2 Agosto 2013, 15:17 pm
Hola, buenos dias!
Pues bien, yo tengo este código:

Código
  1. package Ajedrez;
  2.  
  3. public class Tablero {
  4. Pieza array[][]=new Pieza[7][7];
  5. public Tablero(){
  6. for(int i=0;i<8;i++)
  7. for(int j=0;j<8;j++)
  8. array[ i][j]=new Pieza();
  9.  
  10. }
  11. void iniciarPartida(){
  12. for(int i=0;i<8;i+=7){
  13. array [ i][0].pz=Piezas.TORRE;
  14. array [ i][1].pz=Piezas.CABALLO;
  15. array [ i][2].pz=Piezas.ALFIL;
  16. array [ i][3].pz=Piezas.DAMA;
  17. array [ i][4].pz=Piezas.REY;
  18. array [ i][5].pz=Piezas.ALFIL;
  19. array [ i][6].pz=Piezas.CABALLO;
  20. array [ i][7].pz=Piezas.TORRE;
  21. }
  22. for(int i=0;i<8;i++){
  23. array [7][ i].cl=Colores.NEGRO;
  24. array [6][ i].pz=Piezas.PEON;
  25. array [6][ i].cl=Colores.NEGRO;
  26. array [1][ i].pz=Piezas.PEON;
  27. array [1][ i].cl=Colores.BLANCO;
  28. array [0 ][ i ].cl=Colores.BLANCO;
  29. }
  30.  
  31. }
  32. }
  33. public static void main(String args[]){
  34. Tablero mitabla= new Tablero();
  35. //System.out.print(mitabla.toString());
  36. }
  37. }
  38. class Pieza {
  39. Piezas pz;
  40. Colores cl;
  41. public Pieza() {
  42.  this.pz=null;
  43.  this.cl=null;
  44. }
  45.  
  46. }
enum Piezas{REY,DAMA,ALFIL,CABALLO,TORRE,PEON};
enum Colores{BLANCO,NEGRO};


Y cuando lo ejecuto me da el sgte. error:

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 7
   at Ajedrez.Tablero.<init>(Tablero.java:8)
   at Ajedrez.Tablero.main(Tablero.java:78)

Yo creo que es del arranque, que no sabe muy bien donde empezar a ejecutarse. Lo digo por que me da fallo en la main y he estado indagando por ahi y es lo que me aparecía.

Agradecería cualquier ayuda.

Un saludo a todos! :D

Páginas: [1]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines