By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,933 Members | 1,574 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,933 IT Pros & Developers. It's quick & easy.

Error: cannot find symbol - constructer IntValues()

P: 23
Hi i'm writing a program where you have to determine the smallest, number of distinctions and the average from an array of values.

in my test class i get an error that says cannot find symbol - constructer IntValues()
here is my program:

public class IntValuesTest
{
public static void main(String args[])
{
int valueNum[] = {45, 84, 56, 79, 63, 92, 76, 54, 61, 72};

IntValues myValues = new IntValues();

System.out.println("Smallest value: " + myValues.getSmall());
System.out.println("number of distinctions: " + myValues.GetDist());
System.out.println("average : " + myValues.getAvg());
}
}



here is my class:

public class IntValues
{
private int smallest;
private int values[];

public IntValues(int small, int val[])
{
smallest = small;
values = val;
}

public int getSmall()
{
int low = values[0];
for (int value : values)
{
if (value < low)
low = value;
}
return low;
}

public int GetDist()
{
int distinction = 0;
for ( int num = 0; num < values.length; num++)
{
if (num >= 75)
distinction = distinction + 1;
}
return distinction;
}

public int getAvg()
{
int total = 0;

for ( int num = 0; num < values.length; num++)
{
total += num;
}
return total / values.length;
}
}
Sep 6 '07 #1
Share this Question
Share on Google+
1 Reply


Expert 10K+
P: 11,448
in my test class i get an error that says cannot find symbol - constructer IntValues()
Yep, the compiler is right (as always): there is no constructor in that class that
doesn't take any parameters. You wrote that class yourself, so check for yourself.

kind regards,

Jos
Sep 6 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.