The Object class contains a method named .getClass() that returns an instance of type Class - that's right, there is a class named Class (sure, why not???). All kidding aside, the class Class contains over 60 methods that you can use to determine various things about an instance of an object. Every class and interface inherits this method either directly or indirectly from the Object class so we can invoke it on just about everything.
The .getClass() method takes no parameters and is super easy to invoke, just tack it on to your reference variable and you are good to go.
Sur cette page du site, vous pouvez voir la vidéo en ligne Learn Java Programming - Object .getClass() and Class Common Methods Tutorial durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Daniel Ross 15 janvier 2016, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 7,679 fois et il a aimé 64 téléspectateurs. Bon visionnage!