• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem in understanding the syntax

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you please clarify the meaning of the following line of code
boolean setFlag(Boolean [] test []);
assume test is some class.Nothing was mentioned in the book.
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by nilesh purohit:
Can you please clarify the meaning of the following line of code
boolean setFlag(Boolean [] test []);
assume test is some class.Nothing was mentioned in the book.


As it's written, the only way I can see this working is inside an interface, as an implicitly abstract method declaration where "test" denotes a 2-dimensional Boolean array.

But if we are to assume that "test" is some class, then we need a comma between these arguments. In that case, the line is close to working as a method call with an added assignment ("b ="), or simply a method call (without "boolean"). That is...

boolean b = setFlag(Boolean[], test[]);

...or just...

setFlag(Boolean[], test[]);

Where did this come from? And what is the context?
 
Ranch Hand
Posts: 457
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ouch, someone hates you,

it looks like a declaration of a method from an interface,
(obviously) it returns a boolean,

it takes a 2 dimensional array of Boolean objects, the parameter name is test,

it would more nicely be coded:

for better or for worse, they are all equivalent

useful examples:
http://www.janeg.ca/scjp/lang/arrays.html
[ December 18, 2007: Message edited by: Bill Shirley ]
 
nilesh purohit
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank to all for clearing the doughts.It was an Interface declarations.But I was not knowing about array declaration can be done in this mannaer also.
Thanks once again
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic