Results 1 to 1 of 1
-
Class Reflection: Is it an interface
Java Code:import java.util.Observable; import java.util.Observer; public class SampleCheckInterface { public static void main(String[] args) { Class observer = Observer.class; Class observable = Observable.class; verifyInterface(observer); verifyInterface(observable); } static void verifyInterface(Class c) { String name = c.getName(); if (c.isInterface()) { System.out.println(name + " is an interface."); } else { System.out.println(name + " is a class."); } } }"The sole cause of man’s unhappiness is that he does not know how to stay quietly in his room." - Blaise Pascal
Similar Threads
-
Class Reflection: Finding out the constructor infomation
By Java Tip in forum java.langReplies: 0Last Post: 04-23-2008, 08:10 PM -
Class Reflection: Finding field infomation
By Java Tip in forum java.langReplies: 0Last Post: 04-23-2008, 08:09 PM -
Class Reflection: Finding implemented interfaces
By Java Tip in forum java.langReplies: 0Last Post: 04-23-2008, 08:09 PM -
Getting class field information using Reflection
By Java Tip in forum Java TipReplies: 0Last Post: 01-24-2008, 03:20 PM -
Getting methods of a Class - Reflection
By Java Tip in forum Java TipReplies: 0Last Post: 11-15-2007, 03:18 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks