Say suppose I have the following Java code.
public class Example {
public static void main(String[] args){
Person person = new Employee();
}
}
How to find out whether the Person is a class or an interface?
Because the Employee class can extend it if it’s a class, or implement it if it’s an interface.
And in both cases Person person = new Employee(); is valid.
If you don’t already know whether
Personis an interface or a class by nature of the documentation for the class/interface itself (you’re using it, presumably you have some docs or something?), you can tell with code:Details here.
Edit: Based on your comment, here’s an off-the-cuff utility you can use:
Usage: