• 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

return statements

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a programming problem where I have to construct a class using constuctors and methods .One of the methods contains an array of ints which has to be called from another class using the main method how do I pass a value to another class if the method with the array has to be declared void ? i think this is the case as return statments can only return single values
 
Ranch Hand
Posts: 1272
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can return a reference to an array or accept an argument that is an array reference and change the elements of the array.

Try this:

or this:


[ February 06, 2005: Message edited by: Mike Gershman ]
[ February 06, 2005: Message edited by: Mike Gershman ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic