The problem I have now is that im doing a method thats going to search for an item based on its price.
So if you type in the correct price the item is printed out. The problem is that the file wont connect to the programe. It works when I write to the file first but it dosent work if I just open it up and do this operation instantly. Any ideas of whats wrong?
Heres the code=
public void sökNummer(LinkedList lista)
{
System.out.print("Priset på varan: ");
String priset=scan.next();
boolean saknas =true;
for(int i=0; i<lista.size() && saknas;i++)
{
produkter temp=(produkter) lista.get(i);
System.out.println(temp.hämtaAntal);
if(priset.equals(temp.hämtaPris()))
{
System.out.println("Vara :" +temp.hämtaVara()+" " );
saknas=false;
}
}
if(saknas)
{
System.out.println("Namnet finns ej:" +priset);
}
Pls I really need help.
Admin Edit: Please use code tags when posting your code. Code tags are used like so =>
Thanks,
PsychoCoder

New Topic/Question
Reply




MultiQuote





|