ilovelinux2006
Programmer
Hello everyone,
If I have the method:
<Li
public Cars findByNumber(String carNumber){
private ListArray<Object> car = new ListArray<Object>();
Now If I convert the String into an Integer:
Integer carnum = new Integer(carNumber);
-- and someone passes letters instead of numbers in the string, I cannot upcast:
Cars whatcar = (Cars)car.get(carnum);
That will come out with an error if the string is anything other than numbers (integers). Is there another way to get a list arrays object other than with an int value, instead a string?
If I have the method:
<Li
public Cars findByNumber(String carNumber){
private ListArray<Object> car = new ListArray<Object>();
Now If I convert the String into an Integer:
Integer carnum = new Integer(carNumber);
-- and someone passes letters instead of numbers in the string, I cannot upcast:
Cars whatcar = (Cars)car.get(carnum);
That will come out with an error if the string is anything other than numbers (integers). Is there another way to get a list arrays object other than with an int value, instead a string?