Solved

Determining Object Type

Posted on 2003-11-15
2
238 Views
Last Modified: 2010-03-31
If I have an Object, but want to determine what subclass of Object it is, is there anyway to do that? In other words, how do I determine object type?
0
Comment
Question by:handle0001
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 92

Accepted Solution

by:
objects earned 75 total points
ID: 9756699
You can get the class using:

Class clazz = o.getClass();

You can test if it is instance of a class/interface using:

if (o instanceof Serializable)
0
 
LVL 92

Expert Comment

by:objects
ID: 9756932
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
maven module vs maven project 3 116
Is Applet the way to go for my drag and drop system? 8 51
How to fix  socket closed error 11 64
Java import explained 4 49
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…
In this post we will learn different types of Android Layout and some basics of an Android App.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

751 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