# Similar to Method Overriding in Java, how to override the method about Box2d

**URL:** https://discourse.processing.org/t/similar-to-method-overriding-in-java-how-to-override-the-method-about-box2d/39706
**Category:** Processing.py
**Created:** [November 14, 2022, 4:49pm UTC](https://discourse.processing.org/t/similar-to-method-overriding-in-java-how-to-override-the-method-about-box2d/39706 "2022-11-14T16:49:49Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![huxx](https://avatars.discourse-cdn.com/v4/letter/h/edb3f5/32.png) [@huxx](https://discourse.processing.org/u/huxx)
#### Post date: [November 14, 2022, 4:49pm UTC](https://discourse.processing.org/t/similar-to-method-overriding-in-java-how-to-override-the-method-about-box2d/39706/1 "2022-11-14T16:49:49Z")

</div>

beginContact() is a method of box2d Library.

I want to use it in processing.py. Due to the difference between java and python, the error comes out:  
You are missing the beginContact() method. java.lang.NoSuchMethodException: jycessing.PAppletJythonDriver.beginContact(org.jbox2d.dynamics.contacts.Contact)

I use the box2d.listenForCollisions(), but it can’t find the beginContact() that I have written.

The raw tutorial code:[Box2D-for-Processing/CollisionListeningDeletionExercise.pde at master · shiffman/Box2D-for-Processing · GitHub](https://github.com/shiffman/Box2D-for-Processing/blob/master/Box2D-for-Processing/dist/box2d_processing/examples/CollisionListeningDeletionExercise/CollisionListeningDeletionExercise.pde)

It’s like some problem of write method Overriding from java into python

The tutorial taught that the beginContact() is used like mousePressed() method.
