Hi guys,
please, help me)))
I am trying to create a VEreyLong Integer class.. I am using ArrayList..
but I have some questions..
this is my code (just the beginning)
package VeryLong;
import java.util.*;
public class VeryLong{
public VeryLong(ArrayList<Integer> a){
ArrayList<Integer> verylong = new ArrayList<Integer>();
System.out.println("number is created");
};
public ArrayList<Integer> Readln(){
int i=0, tempint=0;
ArrayList<Integer> verylong = new ArrayList<Integer>();
Scanner in = new Scanner(System.in);
String str;
str=in.next();
while (Character.isDigit(str.charAt(i)))
{
tempint = Integer.parseInt( Character.toString( str.charAt(i) ) );
verylong.add(tempint);
i++;
};
return verylong;
}
}
so, in readln method, I am trying to read a string from console, then write each char (which is digit) to ArrayList, then I have to claim that that created ArrayList is my class VeryLong integer, right? But in this case, ArrayList functions will not be available for me.. So do I need to make my class VeryLong smth like
VeryLong extends ArrayList???? But in this case, how do I block other ArrayList methods, which I don't need..
I know, that it sounds really confusing.. but please, help me!!!)))
