Jump to content

Como eliminar elementos iguais numa tabela


Recommended Posts

Posted (edited)

Boa noite

tenho o seguinte metodo que supostamente elimina os valores iguais da tabela "tab" que é do tipo Peca mas nao ta a fazer nada :/ alguma sugestao?

public void eliminaPecas() {

	for (int i = 0; i < LINHA; i++) {
		for (int j = 0; j < COLUNA; j++) {
			if (tab[i].equals(tab[j].equals(tab[j + 1].equals(tab[j + 2])))) {
				tab[i][j] = new Peca(' ');
			}
		}
	}
}

PS: a tabela "tab" como s pod ver é bidimensional

Edited by Baderous
geshi

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.