# Not sure why interface and implementation is not working

**URL:** https://discourse.processing.org/t/not-sure-why-interface-and-implementation-is-not-working/18736
**Category:** Beginners
**Created:** [March 17, 2020, 2:55pm UTC](https://discourse.processing.org/t/not-sure-why-interface-and-implementation-is-not-working/18736 "2020-03-17T14:55:27Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![jeromepayne](https://avatars.discourse-cdn.com/v4/letter/j/d2c977/32.png) [@jeromepayne](https://discourse.processing.org/u/jeromepayne)
#### Post date: [March 17, 2020, 2:55pm UTC](https://discourse.processing.org/t/not-sure-why-interface-and-implementation-is-not-working/18736/1 "2020-03-17T14:55:27Z")

</div>

Can you all take a look at my code and tell me where I am going wrong?

interface IBeacon {  
// Determines whether beacon is within range of truck  
Boolean isPresent();  
// Determines how for beacon is from truck  
int getDistance();  
}

class Route implements IBeacon {  
String name;  
char line;  
String route;  
String station;  
int distance;

Route(String name, char line, String route, String station, int distance) {  
this.name = name;  
this.line = line;  
this.route = route;  
this.station = station;  
this.distance = distance;  
}  
public Boolean isPresent() {  
if (this.distance\<=10) {  
}  
return true;  
}

int getDistance() {  
return this.distance;  
}  
}

---

<div class="post-metadata">

### Author: ![TfGuy44](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tfguy44/32/41_2.png) [@TfGuy44](https://discourse.processing.org/u/TfGuy44)
#### Post date: [March 17, 2020, 4:33pm UTC](https://discourse.processing.org/t/not-sure-why-interface-and-implementation-is-not-working/18736/2 "2020-03-17T16:33:40Z")

</div>

Is this Processing code?

---

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [March 17, 2020, 8:06pm UTC](https://discourse.processing.org/t/not-sure-why-interface-and-implementation-is-not-working/18736/3 "2020-03-17T20:06:32Z")

</div>

When you post, please help us by [formatting your code](https://discourse.processing.org/faq#format-your-code) with the `</>` button or by putting ``` above and below your code block.

You might want to check out the `implements` reference page:

[https://processing.org/reference/implements.html](https://processing.org/reference/implements.html)

---

<div class="post-metadata">

### Author: ![jeromepayne](https://avatars.discourse-cdn.com/v4/letter/j/d2c977/32.png) [@jeromepayne](https://discourse.processing.org/u/jeromepayne)
#### Post date: [March 18, 2020, 1:22pm UTC](https://discourse.processing.org/t/not-sure-why-interface-and-implementation-is-not-working/18736/4 "2020-03-18T13:22:55Z")

</div>

Yes this is processing code.

---

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [March 18, 2020, 2:22pm UTC](https://discourse.processing.org/t/not-sure-why-interface-and-implementation-is-not-working/18736/5 "2020-03-18T14:22:20Z")

</div>

This is just an interface and a class. How are you using them in setup or draw? What error(s) are you getting?
