Restricted Methods in java

Write here if you have problems with your Java source code

Moderator: Board moderators

Post Reply
smart_malk
New poster
Posts: 5
Joined: Sat Feb 26, 2005 5:44 am
Location: Canada

Restricted Methods in java

Post by smart_malk »

Does anyone know which are the restricted methods or classes for java?? I cant believed i spend the whole afternoon doing p101 with StringBuffer to get 7 compiler errors from uva saying that the methods delete and indexOf where not found!!!!! I mean.... that should be illegal!!!!
what are the restricted methods!!! so next time i know what to use and what not!!!!!!!!!!!!!!!!!!!!!!

SmartMalk
Sedefcho
A great helper
Posts: 374
Joined: Sun Jan 16, 2005 10:18 pm
Location: Bulgaria

Post by Sedefcho »

Man, I am also a Java programmer.
Half of the problems I've solved I've implemented in Java
and the other half of them I've implemented in C/C++.

Do you know what version of Java this Online Judge supports ?
Just read some more about the Java support in the UVa Judge,
that's what I would offer you. Don't worry I was also frustrated
a bit in the beginning but once you know what version of JDK
this Judge supports you have less problems and the Java support
seems pretty OK.

Of course there're some problems with the Java support but they
are not of the form : Oh, the Judge says that in
class Alfa the method beta() is missing. What is this now ?


The answer to the above question is - the Judge supports JDK 1.1.x.
JDK 1.1.x was released somewhere in 1999, so it's quite an old
version. Most of the methods which exist today in the last versions
of JDK ( 1.3.x and 1.4.x ) were not in place in JDK 1.1.x.

Download that very old version of JDK and check if the
StringBuffer class has these methods. You can see this in
the API docs ( I guess you are pretty familiar with Java and
the terms I use ). Here is the official site where you can find JDK 1.1.x :
http://java.sun.com/products/archive/jdk/1.1.8_010/

If you don't want to do this, I can simply give you the answer.
No, there're no such methods in the StringBuffer
class ( remember that we assume we are using JDK 1.1.x ).

Of course, if you have on your machine a version of JDK which
is let's say 1.3.x or 1.4.x then you see things much differently.
But the judge doesn't see them this way :)
You should try to be compliant with the version
of JDK supported by this Judge. If you want to use Java
with this Judge of course.

One more thing - the methods you mention are not restricted
methods. Not at all. Restricted methods are for instance such
methods which cause a file to be created on the
hard disk of the machine on which your code gets executed
( like some methods of classes residing in the java.io package ).

These methods are called restricted. The methods you have
problems with are just non-existing ( in JDK 1.1.x ).
smart_malk
New poster
Posts: 5
Joined: Sat Feb 26, 2005 5:44 am
Location: Canada

Post by smart_malk »

lol fair enough, thanx... I'll be back here when they update the version or when i download the c/c++ compiler =)

thanx
Post Reply

Return to “Java”