|
Array Constructor
I am trying to write code for a class that has a 40element array in it and i want to use the 2nd set of code to just input the numbers and print it out for now. I have to do a bunch with the ints later but i cannot figure out how to write the constructor.
I am not sure if I have given enough information for someone to help, but I do not know what else to do. I have spents hours looking at this. Thanks for your help.
public class HugeInteger
{
//Instance Variables
int[] hugeArray=new int [41];
//constructor
HugeInteger(
{
}//End Constructor
}//End Class
*************************
{
public static void main(String args[])
{
// smaller numbers
HugeInteger i = new HugeInteger(9999);
HugeInteger j = new HugeInteger(1);
HugeInteger k = new HugeInteger(-9999);
HugeInteger l = new HugeInteger(-1);
System.out.println(i);
}
}
|