how to find Type of object at runtime in Java

Tutorials Shared by the Internet Community

Advertisements


Synopsis

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 - 27132

  • Total Votes - 98 votes

  • Vote Up - 42 votes

  • Vote Down - 56 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. ...


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

Advertisements