System.out.println("Enter your value(s).");
for (int n = 0; n < array.length; n++)
{
array[n] = console.nextInt();
}
this is going to ask the user to...
Type: Posts; User: javapenguin
System.out.println("Enter your value(s).");
for (int n = 0; n < array.length; n++)
{
array[n] = console.nextInt();
}
this is going to ask the user to...
Wouldn't the methods in the first class have to be static too to be used in the main method of the second class? I thought static methods could only call other static methods.
Maybe I'm wrong.
You have dividend set to 0. What if you called getDivide()?
sqroot = Math.sqrt(getDivide());
return(sqroot);
and in getDivide()
I think the Math class returns a double.
Try casting it to an int:
sqroot = (int) Math.sqrtrt(dividend);
I think it needs a () around the word int, but try {} if it doesn't work.
or...