0

Hi,
This is the line: Class ourClass = new Class.forName("com.app.something");

And this is the the error: cannot find symbol class forName

My IDE is Intellij Idea.

This is a particular case, but i want to know what causes this type of error, what should i look for.

3
Contributors
4
Replies
6
Views
6 Years
Discussion Span
Last Post by JamesCherrill
1

The keyword "new" is wrong here. You are just calling the static method "forName" in the Class class. It's not a constructor.
Class ourClass = Class.forName("com.app.something");

0

Yes indeed, thank you, sometime you miss those details.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.