• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Returning an Array to a class.  RSS feed

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have a method whose return type is an array of a class in which after performing the necessary operation I am returning it.

I want to store the returned value into the same class(i.e. another array of the same class).

Code:

Here is the method:

In this 'Employee' is a class which contains setters and getters.



Iam calling this method using:
Employee emp[]=HR.selectDivisionHeads();

But I am getting a error msg stating:

"Method does not return a value"

Please help me in resolving this issue.
Thank you.
 
author & internet detective
Posts: 39283
727
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mohammed,
The return statement has a typo. It should be " return empRecords;" rather than "return empRecord;"
 
Time is the best teacher, but unfortunately, it kills all of its students - Robin Williams. tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!