• Post Reply Bookmark Topic Watch Topic
  • New Topic

parsing array to method  RSS feed

 
Farakh khan
Ranch Hand
Posts: 833
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

My code is getting array value but I don't know how to pass it to the method. Please help me



Errors:


Thanks in anticipation

Best regards
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66307
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please take the time to choose an appropriate forum for your posts. This forum is for questions on Servlets. For more information, please click this link ⇒ CarefullyChooseOneForum.

This post has been moved to a more appropriate forum.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't understand the code fragment you're posting or how it's related to the error messages--is that a single file of actual source?
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Farakh khan wrote:
Errors:


When parsing an array to a method, you don't use [] - only the name of the array.

e.g.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you pass an array as an argument to a function, you just use the name of the array, which does not include the square brackets:

cd.addImpInfo(cvId, keywords, specialty, certification, license, mLang, ...

Now, a bit of advice: methods ought never to take more than six arguments, and three or less is best. A method with that many arguments is almost impossible to call correctly -- it's going to be so incredibly easy to mix up the order of the arguments!

[ Edit: too late! ]
 
Campbell Ritchie
Marshal
Posts: 56570
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Careful about spellings in your thread titles. You said "parsing" when you meant "passing". Both words are correct English, but mean different things.
 
Farakh khan
Ranch Hand
Posts: 833
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ernest Friedman-Hill wrote:When you pass an array as an argument to a function, you just use the name of the array, which does not include the square brackets:

cd.addImpInfo(cvId, keywords, specialty, certification, license, mLang, ...

Now, a bit of advice: methods ought never to take more than six arguments, and three or less is best. A method with that many arguments is almost impossible to call correctly -- it's going to be so incredibly easy to mix up the order of the arguments!

[ Edit: too late! ]


Thanks all for helping. Problem solved



best regards
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!