ArrayList

Write here if you have problems with your Java source code

Moderator: Board moderators

Post Reply
Diueine
New poster
Posts: 1
Joined: Tue Nov 20, 2001 2:00 am
Contact:

Post by Diueine » Tue Nov 20, 2001 5:48 pm

Since I have registered at UVA h service I always have used ArrayList in my problems solutions, and always it worked.
Although, in the last 2 days I am receving a compiler error message:

00658362_24.java:7: Type `ArrayList' not found in the declaration of the local
variable `a'.
ArrayList a = new ArrayList();
^
1 error


I already tryed everithing I could think. I would like a judge, moderator or any other who knows what is hapening, please tell me. Cannot I use Collections anymore??

Thanks a lot.

Fireball
New poster
Posts: 3
Joined: Wed Apr 24, 2002 3:24 pm
Location: MUNICH!
Contact:

same Problem

Post by Fireball » Wed Apr 24, 2002 3:32 pm

So...

i have the same Problem... except that the judge compile the import statement

import java.util.ArrayList;

but doesn't know the class when you use it afterwards.

The judge also doesn't know

import java.util.Iterator;

My compile errors:

00833278_24.java:7: Class or interface `java.util.Iterator' not found in import.
import java.util.Iterator;
^
00833278_24.java:43: Type `java.util.ArrayList' not found in the declaration of the argument `points' of method `Output'.
void Output(java.util.ArrayList points) {
^
00833278_24.java:44: Type `java.util.Iterator' not found in the declaration of the local variable `e'.
java.util.Iterator e = points.iterator();
^
00833278_24.java:77: Type `java.util.ArrayList' not found in the declaration of the local variable `inputList'.
java.util.ArrayList inputList = new java.util.ArrayList();
^
00833278_24.java:97: Type `java.util.ArrayList' not found in the declaration of the local variable `pointlist'.
java.util.ArrayList pointlist;
^
00833278_24.java:99: Type `java.util.Iterator' not found in the declaration of the local variable `e'.
java.util.Iterator e = inputList.iterator();
^
6 errors


Does somebody know a workaround?

P.S.: Why can't the judge compile inner classes?

Fireball

drewsome
New poster
Posts: 16
Joined: Mon Dec 01, 2003 1:20 am
Contact:

Post by drewsome » Mon Dec 01, 2003 1:22 am

I'm having the same problem too. It would be great if someone could fix it :)

Spike
New poster
Posts: 29
Joined: Mon Mar 18, 2002 2:00 am
Location: Washington State
Contact:

Post by Spike » Sun Dec 07, 2003 11:09 pm

I feel like a broken record. Most of the java.util functions don't work with UVA's java compiler. In addition, they are running a gcj compiler that supports some java 1.2 functions, so if it was added in 1.3 or 1.4, tough luck.

It's also a pain in the butt trying to use one of the few things that they do support, and what you'll probably have to use if you're not just too fed up with the site to keep trying. java.util.Vector.

Vectors are supported, but you have to use the old vector methods. Don't use .add() use .addElement() and so on...

drewsome
New poster
Posts: 16
Joined: Mon Dec 01, 2003 1:20 am
Contact:

Post by drewsome » Mon Dec 08, 2003 12:06 am

Yeah.. I really hope they upgrade their java support soon :)

It's horrible.. you can't even do basic sorting using the Arrays or Collections classes.

Argh.. maybe I'll have to bite the bullet and learn the C++ STL.

Post Reply

Return to “Java”