Solved

Determining Interfaces implemented at Runtime

Posted on 1998-06-03
1
227 Views
Last Modified: 2010-04-16
Is there a way to determine at runtime what interfaces an object implements?
0
Comment
Question by:Renae
1 Comment
 
LVL 4

Accepted Solution

by:
evijay earned 50 total points
ID: 1222055
Suppose you want to determine interfaces implemented by some object o. Do the following

Class[] list = o.getClass().getInterfaces();
for (int i = 0; i < list.length; i++)
System.out.println(list[i].getName());

0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question