Solved

Determining Object Type

Posted on 2003-11-15
2
231 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
  • 2
2 Comments
 
LVL 92

Accepted Solution

by:
objects earned 75 total points
Comment Utility
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
Comment Utility
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
IT Company 5 68
Java Message handling in Service Layer 3 37
thymeleaf natural templating vs JSP 2 23
github account with ecipse 1 15
For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
This video teaches viewers about errors in exception handling.

744 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now