This week's giveaway is in the Groovy forum.
We're giving away four copies of Groovy Fundamentals video training course and have Ken Kousen 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


Win a copy of Groovy Fundamentals video training course this week in the Groovy forum!
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: 14814
    
  26

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
Rancher

Joined: Mar 22, 2005
Posts: 42956
    
  73
Just for future reference: you don't need to post again, you can use the button to edit a post.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: More examples of such code..