Question: In my project I have JSP pages that should print PDF documents

Answer: 
The method `add` should return boolean value, so all what you need to do is

```
public boolean add(MyObject newvalue) {
    boolean retVal = super.add(newvalue);
    Result = Double.NaN;
return retVal ;
}

```
This is a good example as to when [composition over inheritance](http://en.wikipedia.org/wiki/Composition_over_inheritance) really makes sense for code design. Your class will become cluttered with unnecessary operations, when it only really needs to have an instance of a `List` of some kind floating around. It also means that you're not hard-dependent on the `ArrayList` implementation; for instance, what if your algorithms called for a `LinkedList` instead? 

But, if you really want to fix what you have...

First and foremost, the reason you're getting the compiler error is because, as far as Java is concerned, you're *trying* to override the `add` method, but don't quite have the signature right.

The correct signature is specified as `boolean add(E)`, but you're overriding it with a signature of `void add(E)`. The types don't match, so you won't get a successful override, and Java will not compile the class, as you can see.

Next, creating more classes to accomplish the same thing as inheriting and properly overriding the `ArrayList` class will not gain you anything; if anything, it will be **more** of an overcomplication.