Win a 3 month subscription to Marco Behler Videos this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Returning an Array from a Method  RSS feed

 
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
Sheriff
Posts: 23260
124
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
Boost this thread!