This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes More examples of such code.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "More examples of such code.." Watch "More examples of such code.." New topic
Author

More examples of such code..

jose chiramal
Ranch Hand

Joined: Feb 12, 2010
Posts: 266
I want to understand the two blocks used in the below code. Also where can i find more examples of such code :
jose chiramal
Ranch Hand

Joined: Feb 12, 2010
Posts: 266
Sorry for posting multiple times.. Was trying to get the format correct. I would like to understand the if block used here. Whats this concept called as ?

Thanks
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14193
    
  20

It's just a normal if-statement. Do you mean that you want to learn what the instanceof operator does?

You can find that here in Sun's Java Tutorials: The Type Comparison Operator instanceof (scroll down on that page).


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
jose chiramal
Ranch Hand

Joined: Feb 12, 2010
Posts: 266
Yes I would like to know how the instanceof operator can be used with interface references and with objects.

Thanks.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42030
    
  64
Just for future reference: you don't need to post again, you can use the button to edit a post.


Ping & DNS - my free Android networking tools app
 
GeeCON Prague 2014
 
subject: More examples of such code..