File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Array Instanceof operator Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Array Instanceof operator" Watch "Array Instanceof operator" New topic
Author

Array Instanceof operator

Sami Devine
Ranch Hand

Joined: Jan 30, 2011
Posts: 44
This example is from SCJP6, Kathy Sierra





I understand that both Foo[] and Foo[1] are instances of Object. What is the difference between Foo[] and Foo[1].


[HENRY: Fixed code tags]
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24166
    
  30

"Foo[]" is meant to suggest an array of Foo objects. Foo[1] is meant to suggest a single element of that array -- i.e., a Foo object.


[Jess in Action][AskingGoodQuestions]
Sami Devine
Ranch Hand

Joined: Jan 30, 2011
Posts: 44
Thank you very much
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Array Instanceof operator
 
Similar Threads
instanceof operator
instanceof operand
Using instanceof operator
instanceof
SCJP6 book page 298 errata