Results 1 to 3 of 3
- 01-27-2012, 04:43 AM #1
Member
- Join Date
- Jan 2012
- Posts
- 7
- Rep Power
- 0
Help with formal parameter, ArrayList
I need to pass an ArrayList named Pairs through my method Encode.
When I run try to compile the code without filling in the parameters, leaving it Encode(), it obviously gives me an error message, which reads:
Encode(java.util.ArrayList) in [myprogram'sname] cannot be applied to ()
How do I format Pairs so that it will correctly compile? I don't understand what it means by java.util.ArrayList; if I were, say, to need to put in a String, it would just read Encode(String), and I wouldn't have to write the variable type, just the name, but this won't work if I try Encode(Pairs)
-
Re: Help with formal parameter, ArrayList
Please show us your code and some context. Have you used ArrayLists at all yet? Also, please re-name your methods and variables so that they all begin with lower case letters. Only classes, interfaces and the like should begin with capital letters.
- 01-27-2012, 06:05 AM #3
Member
- Join Date
- Jan 2012
- Posts
- 7
- Rep Power
- 0
Similar Threads
-
ArrayList copy some of the element from one arraylist tnto another arraylist
By ralf in forum New To JavaReplies: 12Last Post: 07-07-2011, 08:49 PM -
how to add Arraylist filter for a jsp page showing results from a servlet-Arraylist
By alok_sharma in forum Java ServletReplies: 7Last Post: 11-22-2010, 01:26 PM -
Using ArrayList as a parameter
By Crypts in forum New To JavaReplies: 6Last Post: 05-13-2010, 06:56 AM -
Formal introduction
By sbliss in forum IntroductionsReplies: 3Last Post: 03-21-2010, 08:40 PM -
Java Project Trouble: Searching one ArrayList with another ArrayList
By BC2210 in forum New To JavaReplies: 2Last Post: 04-21-2008, 11:43 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks