Determining class with a Java instanceOf example - 032

Опубликовано: 08 Сентябрь 2015
на канале: Deege
6,112
124

What if we need to know the specific class for an instance in our list? In this lesson we're going to take a quick look at how we can determine the class of an instance.

When we need to test an instance to see what class it belongs to, we can use the keyword instanceof. This keyword acts as a binary operator. It takes an instance and a class as the two operators. The instance is any object variable, and class is any java.lang.Class object.

Transcript and code: http://www.deegeu.com/java-instanceof...

This video is part of a larger free online class called Free Java Course Online. You can find more information about this class on http://www.deegeu.com/free-java-cours...

Concepts: Java, Programming, instanceof, class, instance

Social Links: Don't hesitate to contact me if you have any further questions.
WEBSITE : [email protected]
TWITTER :   / deege  
FACEBOOK:   / deegeu.programming.tutorials  
GOOGLE+ : http://google.com/+Deegeu-programming...

About Me: http://www.deegeu.com/about-programmi...

Related Videos:

Free Java Course Online
   • Free Java course online for beginners  

If You Watch 1 Playlist About Java Classes Watch this One!
   • If You Watch 1 Playlist About Java Cl...  

Media credits: All images are owned by DJ Spiess unless listed below

Background from pixabay.com