This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum 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
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Reply 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
Bartender

Joined: Aug 16, 2005
Posts: 12950
    
    3

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 7 API documentation
Scala Notes - My blog about Scala
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: 35438
    
    9
Just for future reference: you don't need to post again, you can use the button to edit a post.


Android appsImageJ pluginsJava web charts
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: More examples of such code..
 
Similar Threads
Question on "instanceof"
Overload / Override
Garbage Collection Problem
General doubt
Interfaces question,