?
Solved

Arraylist problem

Posted on 2008-11-12
3
Medium Priority
?
247 Views
Last Modified: 2012-05-05
Hi all,

I have changed code in my project around and am now getting an annoying error. In one class (which i copied exactly) i am unable to use the ARRAYLISt.add(intVARIABLE) method.

public void setPlayer1Sets(int player1Sets) {
                  this.player1Sets.add(player1Sets);
            }

the code is exactly the same in both projects but one only throws a warning whereas the new one throws a 'The method add(int, Object) in the type ArrayList is not applicable for the arguments (int)' error

Thanks
0
Comment
Question by:billyleo
  • 2
3 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 2000 total points
ID: 22941726
One of your projects, i.e. the one that's not working, is using < Java 1.5
0
 

Author Closing Comment

by:billyleo
ID: 31516018
perfect - i noticed that the minute i clicked post - thanks
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 22943893
:-)
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Suggested Courses
Course of the Month15 days, 15 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question