|
Help with debugger!!
Hi, I'm new to Java and I have to write a method which counts the business days between two given days. I've already written it but it doesn't seem to work, and when I try the debugger it doesn't work and displays "no current thread to display", please help!!!!!
This is the code:
public String diasHab (int dia1, int mes1, int agno1, int dia2,
int mes2, int agno2)
{ int d1 = dia1;
int m1 = mes1;
int a1 = agno1;
int d2 = dia2;
int m2 = mes2;
int a2 = agno2;
String diasN = diasNat (d1, m1, a1, d2, m2, a2);
int diasNa = Integer.parseInt(diasN);
String j1 = diaSem (d1, m1, a1);
int j = Integer.parseInt (j1);
int [] semana = {0, 1, 2, 3, 4, 5, 6};
int resultado = 0;
int cuenta = 0;
int numRest = 0;
String resdev = "";
if ((Validez (dia1, mes1, agno1) == true) && (Validez (dia2, mes2, agno2)
== true))
{
while (cuenta != diasNa)
{ if ((semana [j] == 0) ||(semana [j] == 6))
{numRest = numRest + 1;
}
j = j+1;
cuenta = cuenta + 1;
if (j == 7)
{j = 0;}
}
resultado = diasNa - numRest;
resdev = Integer.toString(resultado);
}
return resdev;
}
|