Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

RTTI (Run-Time Type Information)

  • 13-05-2013 9:30pm
    #1
    Closed Accounts Posts: 2,663 ✭✭✭


    Have an Exam 2moro and this Question came up on one of the Past Papers..



    What is Rtti?
    What are the two main situations when RTTI is used?
    Give an example of each case. What is the main limitation of RTTI and what java feature is used to overcome this limitation?



    RTTI is Run-Time Type Information
    term that refers to retaining type information at run time


    but i cant what are the Main limitation of RTTI and what can some one do to over come this limitation


Comments

  • Registered Users Posts: 76 ✭✭Punchin A Keyboard


    Even though the exam is gone, I presume this may be a c++ vs java question but my assumptions as well as my answer could be ****e.

    In c++ casting is used for rtti but you only know the internals of what you are casting too not the object being casted.
    In Java as a VM is being used, reflection was added to it so you can query the internals of an object.
    These internals are methods and signatures however I do not think return types can be determined by reflection. Even the privates of an object can be got/manipulated with reflection but underpants (accessor controls) are there for a reason.

    My 2c


Advertisement