Java - Ayuda con arraylist gracias =)

 
Vista:
Imágen de perfil de DAvid

Ayuda con arraylist gracias =)

Publicado por DAvid (6 intervenciones) el 16/11/2014 01:36:26
Hola me podria ayudar con una calculadora de polinomios que estoy haciendo es que no se que tenga.

el problema es el if de metodos apenas estoy haciendo de que sume terminos iguales pero solo entra una vez al if cuando deberia de entrar mas de 2 veces

http://www.4shared.com/zip/HpB7T7bUce/calculadoradepolinomi.html

en el array list tipos de variable estan los tipos de variable que hay en todo el polinomio
en el otro array list terminosDelPolinomio esta todos los terminos del polinomio y es de tipo objeto el objeto tiene variables y numeros separados con metodos get y set

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
for(int w=0; w<tiposDeVariable.size(); w++){  //inicio del for
 
			for(int y=0; y<terminosDelPolinomios.size();y++){
 
				System.out.println("variable1 "+tiposDeVariable.get(w));
				System.out.println("variable2 "+terminosDelPolinomios.get(y).getVariables());
 
				if(tiposDeVariable.get(w)==terminosDelPolinomios.get(y).getVariables()){
 
			            total=total+terminosDelPolinomios.get(y).getNumeros();
			            System.out.println("entra y suma "+total);
 
		                    }else{}
			}//fin for interno
 
		}//fin for externo

No hay errores de sintaxsis ya revise lo otro y esta bien solo de que en el if solamente entra una vez cuando los terminos son iguales
estosolo_entra_una_vez_al_if
si me pudieran ayudar estaria de tetas

GRACIAS

Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder