• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Returning an Array to a class.

 
Mohammed Shareefuddin
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.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
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;"
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic