wood burning stoves 2.0*
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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "More examples of such code.." Watch "More examples of such code.." New topic

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 ?

Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074

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.

Ulf Dittmer

Joined: Mar 22, 2005
Posts: 41147
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
I agree. Here's the link: http://aspose.com/file-tools
subject: More examples of such code..
Similar Threads
Overload / Override
Question on "instanceof"
General doubt
Interfaces question,
Garbage Collection Problem