how to find Type of object at runtime in Java

Tutorials Shared by the Internet Community

Advertisements


how to find Type of object at runtime in Java

Java doesnt support RTTI or Runtime Type Identification like C++ programming language but still provides some ways to find type of object at runtime

Statistics

  • Total Hits - 31588

  • Total Votes - 101 votes

  • Vote Up - 43 votes

  • Vote Down - 58 votes

  • Domain - javarevisited.blogspot.com

  • Category - JAVA/JAVA Misc

  • Submitted By - Javin Paul

  • Submitted on - 2013-01-25 15:53:54

Description

Java doesnt support RTTI or Runtime Type Identification like C++ programming language but still provides some ways to find type of object at runtime. This article explores those ways like using instanceof and Class getClass method and there advantage over each other.    More detail...


Broken  |   Tweet  |   Facebook  |     |   Save  |   Liked  |   Down

Advertisements