# 'Util' bad, but 'Utility' good?!

**URL:** <https://discourse.processing.org/t/util-bad-but-utility-good/27649>\
**Category:** Development\
**Created:** [February 7, 2021, 2:07pm UTC](https://discourse.processing.org/t/util-bad-but-utility-good/27649 "2021-02-07T14:07:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aleksi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/aleksi/32/11065_2.png) [@Aleksi](https://discourse.processing.org/u/Aleksi)\
**Post date:** [February 7, 2021, 2:07pm UTC](https://discourse.processing.org/t/util-bad-but-utility-good/27649/1 "2021-02-07T14:07:41Z")

</div>

Can someone please help me understand why the constructor of a class name `Util` doesn’t work, yet it does for a class named `Utility`?

I’m still wrapping my head around Eclipse. For a simple _get to know how to use Eclipse to build my own processing libraries_ test I thought I’d just duplicate git’s `processing-library-template-master's` `HelloLibrary` class and rename the class to `Util`. I also duplicated the example `pde` file.

To my astonishment the example failed.

Being new at Eclipse, I wondered if I did something wrong. No, I don’t think so, everything looked right.

So I tried it again, this time thinking maybe I should spell out `Util` to `Utility`. And then it worked.

WTF?!

Here’s the code for each of the three classes:

**HelloLibrary**

```
package ccpd.library;

import processing.core.*;

public class HelloLibrary {
    
    // myParent is a reference to the parent sketch
    PApplet myParent;
    public final static String VERSION = "##library.prettyVersion##";
    
    public HelloLibrary(PApplet theParent) {
        myParent = theParent;
        welcome();
    }

    private void welcome() {
        System.out.println("##library.name## ##library.prettyVersion## by ##author##");
    }
    
    public String sayHello() {
        return "hello library.";
    }
}

```

**Util**

```
package ccpd.utilities;

import processing.core.*;

public class Util {
    
    // myParent is a reference to the parent sketch
    PApplet myParent;
    public final static String VERSION = "##library.prettyVersion##";

    public Util(PApplet theParent) {
        myParent = theParent;
        welcome();
    }
    
    private void welcome() {
        System.out.println("##library.name## ##library.prettyVersion## by ##author##");
    }
    
    public String sayHello() {
        return "hello Util.";
    }
}

```

**Utility**

```
package ccpd.utilities;

import processing.core.*;

public class Utility {
    
    // myParent is a reference to the parent sketch
    PApplet myParent;
    public final static String VERSION = "##library.prettyVersion##";

    public Utility(PApplet theParent) {
        myParent = theParent;
        welcome();
    }
    
    private void welcome() {
        System.out.println("##library.name## ##library.prettyVersion## by ##author##");
    }
    
    public String sayHello() {
        return "hello Utility.";
    }
}

```

Here’s what they look like when the example for each is loaded:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/c/ca212535cb279dba3d4b6f14dd65f784b9ca2347.png)

I checked. `Util` is not a reserved word, so what’s the problem?

Now I’m paranoid, wondering what other nasty and seemingly illogical surprises await me…

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [February 7, 2021, 2:13pm UTC](https://discourse.processing.org/t/util-bad-but-utility-good/27649/2 "2021-02-07T14:13:22Z")

</div>

> [@Aleksi](#):
>
> I checked. `Util` is not a reserved word, so what’s the problem?

I think processing IDE doesn’t like it when you have a class in a Sketch that is saved with the same name as the class.

---

<div class="post-metadata">

**Author:** ![Aleksi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/aleksi/32/11065_2.png) [@Aleksi](https://discourse.processing.org/u/Aleksi)\
**Post date:** [February 7, 2021, 2:16pm UTC](https://discourse.processing.org/t/util-bad-but-utility-good/27649/3 "2021-02-07T14:16:45Z")

</div>

**D’OH!**

Yeah… Thanks @Chrisir!
