Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Class.isAssignableFrom(Class)

Gen.JavaNov 28 2006 — edited Nov 28 2006
Hello everyone,

The following method executes correctly but produces an unchecked warning: [unchecked] unchecked call to isAssignableFrom(java.lang.Class<?>) as a member of the raw type java.lang.Class
private static boolean ImplementsInterface (
Class                  TypeClass,
Class                  Int                 )
{
Class Interfaces[];

Interfaces = TypeClass.getInterfaces ();
for ( Class i:Interfaces )
      if ( Int.isAssignableFrom(i) )
           return true;
return false;
}
TypeClass is a class and Int is an interface.

Thank you
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 26 2006
Added on Nov 28 2006
4 comments
356 views