• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Returning an Array from a Method

 
Tony Costello
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all I am attempting to write a method which gathers values from a text file, sticks em in an array and return the array.

I keep getting an error upon compiling:

java:41: '.class' expected
return age[];


Here is my code:

 
Henry Wong
author
Marshal
Pie
Posts: 22124
88
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The parameter "age", is an int array, and you need to return an int array... so...



is what you want.

Henry
 
Tony Costello
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh geez.....thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic