Error Type Arraylist Does Not Take Parameters
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this type arraylist does not take parameters java site About Us Learn more about Stack Overflow the company Business Learn
Type Class Does Not Take Parameters
more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x
Error: Type Does Not Take Parameters
Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Error
Type List Does Not Take Parameters Netbeans
using ArrayList in Java up vote 2 down vote favorite I was solving a problem before including it in my code and using List to get strings then work around with them. I got the error: "type List does not take parameters List words = new ArrayList();" after compilation. I searched but the syntax i use is correct, please whats wrong with the code? type does not take parameters scala import java.util.Scanner; import java.util.ArrayList; public class List{ public static void main(String args[]){ List words = new ArrayList(); Scanner input = new Scanner(System.in); for (int i=0; i < 3; i++) words.add(input.nextLine()); System.out.println(words); } } java share|improve this question asked Jan 21 '13 at 18:07 Plaix 124316 2 Never ever use pre-defined class names as your own class name. –Rohit Jain Jan 21 '13 at 18:10 OK thank you! i realise that now :D –Plaix Dec 13 '13 at 22:31 add a comment| 2 Answers 2 active oldest votes up vote 8 down vote accepted This is one of the reasons you should use unique names for your own classes. You are really meaning to use java.util.List, but since you called your class List as well, the real problem is masked. Rename your class and add the import for java.util.List to fix the issue: import java.util.Scanner; import java.util.List; import java.util.ArrayList; public class MyClass{ public static void main(String args[]){ List words = new ArrayList(); Scanner input = new Scanner(System.in); for (int i=0; i < 3; i++) words.add(input.nextLine()); System.out.println(words); } } share|improve this answer answered Jan 21 '13 at 18:09 Perc
here for a quick overview of the site Help Center Detailed answers to any questions type list does not take parameters java you might have Meta Discuss the workings and policies of type stack does not take parameters java this site About Us Learn more about Stack Overflow the company Business Learn more about hiring java arraylist developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a http://stackoverflow.com/questions/14444657/error-using-arraylist-in-java community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Trouble with ArrayList in NetBeans7.2 up vote 3 down vote favorite I'm new to Java, but I'm loving it! I'm using NetBeans7.2, and when I try to create an ArrayList like this: ArrayList http://stackoverflow.com/questions/12682922/trouble-with-arraylist-in-netbeans7-2 list = new ArrayList<>(); NetBeans says "type ArrayList does not take parameters" (which doesn't make sense, as my code is simple and seams to be correct for Java7). Also, when I try to import: import java.util.ArrayList; NetBeans says "ArrayList is already defined in this compilation unit". It's not necessary to import ArrayList anymore? Thank you very much! Please, forgive my bad english ;) EDIT: Here is my full code (it's just an exercice) import java.util.ArrayList; public class ArrayList { public static void main(String[] args) { ArrayList cores = new ArrayList<>(); cores.add("Branco"); cores.add(0, "Vermelho"); cores.add("Amarelo"); cores.add("Azul"); System.out.println(cores.toString()); System.out.println("Tamanho= " + cores.size()); System.out.println("Elemento2= " + cores.get(2)); System.out.println("Indice Branco= " + cores.indexOf("Branco")); cores.remove("Branco"); System.out.println("Tem Amarelo?" + cores.contains("Amarelo")); } } java netbeans arraylist share|improve this question edited Oct 2 '12 at 0:34 asked Oct 2 '12 at 0:21 Rafael Borges 120116 Are you sure about this? I don't have those problems in my pc. –Luiggi Mendoza Oct 2
java.util.List does not take parameters" Summary: Maven Project: "type java.util.List https://netbeans.org/bugzilla/show_bug.cgi?id=108542 does not take parameters" Status: RESOLVED DUPLICATE of bug 101020 Product: java Classification: Unclassified Component: Source Version: 6.x Hardware: Macintosh Mac OS X Priority: P3 (vote) TargetMilestone: 6.x Assigned To: Jan Lahoda QA Contact: issues@java URL: Whiteboard: Keywords: Depends on: Blocks: Show dependency tree /graph Reported: 2007-06-29 20:59 UTC by sidharthkuruvila Modified: does not 2007-07-02 09:19 UTC (History) CC List: 0 users See Also: Issue Type: DEFECT Exception Report : Attachments Add an attachment (proposed patch, testcase, etc.) Note You need to log in before you can comment on or make changes to this bug. Description sidharthkuruvila 2007-06-29 20:59:01 UTC On netbeans 6 m9. in maven projects Declarations does not take of type List l; flag an error with the tooltip "type java.util.List does not take parameters" This apears to be specific to java.util.List; ArrayList works fine. Comment 1 Milan Kubec 2007-07-02 07:52:16 UTC Passing to java for further investigation, but I'm not able to reproduce. Comment 2 Jan Lahoda 2007-07-02 09:19:28 UTC Seems like issue #101020 - can be workarounded by deleting the caches (${userdir}/var/cache/index/0.3). Is fixed for M10 (please note that once the caches are broken, they will not correct themselves - you will need to clear them to get correct behavior in M10). Thanks. *** This issue has been marked as a duplicate of 101020 *** Format For Printing -XML -Clone This Bug -Top of page First Last Prev Next This bug is not in your last search results. SiteMap About Us Contact Legal & Licences By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by