Even for objects of classes that you declare, you can use the same method to check if one extends another, or if one implements interface. Just instead class name use subInstance.getClass(), everything else is the same.
You can also use getSuperclass() method to see if your class or instance of it extends from another class, and getInterfaces() to list all the interfaces your class implements.
Edit: You changed your response in the meantime, so now I see the first answer is suitable for you.
Joined: Sep 16, 2012
i have to classes names as strings.
and i want to know if one class extends or implements the othe class;