# newInstance() method

**URL:** <https://discourse.processing.org/t/newinstance-method/25324>\
**Category:** Coding Questions\
**Created:** [November 10, 2020, 2:06pm UTC](https://discourse.processing.org/t/newinstance-method/25324 "2020-11-10T14:06:44Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [November 10, 2020, 5:39pm UTC](https://discourse.processing.org/t/newinstance-method/25324/5 "2020-11-10T17:39:07Z")

</div>

> [@\[SOLVED\] Instantiating a particular class constructor using reflection](https://discourse.processing.org/t/solved-instantiating-a-particular-class-constructor-using-reflection/7968):
>
> Hello again, oh great Java gurus! star_struck I find myself having to instantiate a class from a string using one of its particular constructors. The [api for getDeclaredConstructors()](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html#getDeclaredConstructor-java.lang.Class...-) indicates this is possible, but the examples I’ve found online of its implementation aren’t clicking for me. Here’s a stripped-down example of what I’m hoping to achieve. import java.lang.reflect.\*; // This PApplet processing session // final String THISPROC = this.getClass().getCanonicalName(); final PApplet…

---

_[View the full topic](https://discourse.processing.org/t/newinstance-method/25324)._
