JAVA Library

Write here if you have problems with your Java source code

Moderator: Board moderators

Post Reply
C8H10N4O2
Experienced poster
Posts: 137
Joined: Wed Feb 27, 2002 2:00 am
Location: Pasadena, CA

JAVA Library

Post by C8H10N4O2 » Sun Apr 14, 2002 3:59 pm

What advantages do JAVA libraries provide over STL? Are they significant enough to warrant me to switch languages to stay competitive?

Stefan Pochmann
A great helper
Posts: 284
Joined: Thu Feb 28, 2002 2:00 am
Location: Germany
Contact:

Post by Stefan Pochmann » Mon Apr 15, 2002 4:25 am

Depends on your goals. If you want to write applications, you might like the graphics components of Java. It also has arbitrary precision arithmetics, regular expressions, some geometry algorithms (in AWT) and lots of other useful stuff. Unfortunately, I don't think much of it is available on the online judge here.

Question for the admins: Could you give us a list of packages or classes of Java that you support? Or the ones that you disable? Or whatever your mechanism is? Which Java version do you run?

As for competitiveness on the online judge: so far I've only used Java in the ICPC when I needed BigInteger. As this is probably still not enabled here, I see no real advantage of Java, only disadvantages, such as parsing/formatting and lack of templates and operator overloading.

C8H10N4O2
Experienced poster
Posts: 137
Joined: Wed Feb 27, 2002 2:00 am
Location: Pasadena, CA

Post by C8H10N4O2 » Mon Apr 15, 2002 6:23 am

You mentioned BigInt on the ICPC. That is exactly what I am trying to find out. Should I get a few years of JAVA experience before I go to the ICPC? :wink:

Stefan Pochmann
A great helper
Posts: 284
Joined: Thu Feb 28, 2002 2:00 am
Location: Germany
Contact:

Post by Stefan Pochmann » Mon Apr 15, 2002 6:40 am

No, a few weeks (or even days) should be enough. If you don't use all that fancy object oriented stuff and the huge library (most of which will never be of use in the ICPC), then Java code looks pretty much like C++ code.

You should start learning the library with the classes in the package java.io (Input/Output), particularly BufferedReader, StreamTokenizer and Printstream.

Then, I'd suggest you look at the package java.math, with its classes BigInteger and BigDecimal.

Also very useful is stuff in java.util, especially the classes Arrays, Collections, Dictionary, Hashtable, Treemap, Treeset, Vector and StringTokenizer.

Oh, I forgot. Of course the very first package you should look at is java.lang, which contains all the basic types.

Look at the API specification at http://java.sun.com/j2se/1.4/docs/api/index.html

It really shouldn't take too long to learn this most useful stuff, but as I said, the BigInteger is probably the only reason you might want to learn Java if it's only for the contest. On the other hand, if you ever want to build a web applet or work for a software company, then knowing Java could be an advantage anyway.

Post Reply

Return to “Java”