Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Cannot Compile

  Asked By: Dukker    Date: Jun 18    Category: Java    Views: 562
  

Here is a very simple program i cannot compile, the err i am getting
is that the main class doesnot recognize the LotteryCompare class. Its
like it doesnt exists. Please any help

...... LotteryCompare class ......
public class LotteryCompare implements Runnable
{
public int[] mine;
public int[] lottery = {1, 3, 11, 24, 26, 29, 32, 33, 34, 37,
39, 44, 47, 48, 51, 60, 64, 69, 70, 72};

public int count=0;

public boolean finished = false;

private Thread runner;


//constructor
public LotteryCompare(int args[])
{
mine = args;

if (runner == null)
{
runner = new Thread(this);
runner.start();
}

}


public void run()
{


//check for match
input(mine, lottery);

finished = true;

}



public void input(int mine[], int lottery[])
{
for(int i = 0; i < mine.length; i++)
{
for(int b=0; b < lottery.length; b++)
{
if(mine[i] == lottery[b])
{ count++;
System.out.println("Matching Number: "
+ mine[i] + " [" + count + "]");
}

}
}
}
}

Share: 

 

2 Answers Found

 
Answer #1    Answered By: Antonio Dunn     Answered On: Jun 18

NOw Compile this ok . It will Shourely Compile I have Compiled It.

 
Answer #2    Answered By: Holly Brown     Answered On: Jun 18

Thanks i already responded to your email
But to all of us, i need those two class  in two different files.
So that main() is in LotteryCheck.java and the computation part is in
LotteryCompare.java

 
Didn't find what you were looking for? Find more on Cannot Compile Or get search suggestion and latest updates.




Tagged: