Close sidebar

Illgal argument Exception in getDeclaredConstructor

I tried accessing the constructor for a class using reflection. getDeclaredConstructor (String.class,List.class,List.class,List.class,List.class) And my actual constructor is a constructor with 1 String parameter and 4 two dimensional list. But this throws Illegal argument exception:wrong number of parameters. But if I pass just 1 or 2 parameters it throws no such method exception not illegal argument. Why this happens?

  • Sujatha
  • 2110 Views
  • 2 Answers
  • getting DeclaredConstructor doesnot give IllegalArgumentException .br /you must change the parameter name. please send me whole problem once.


Dicussion/Forum
core java
Ask New Question
Reputation board for
Core Java
Community Moderator
Only Youth and Educator can become Moderator.