Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Help with initializing Lists

  1. #1
    Junior Member
    Join Date
    Feb 2012
    Posts
    20
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Help with initializing Lists

    So I know this is a really basic question but... I couldn't find an answer anywhere online. I'm trying to initialize a List with the following line of code:

    List<String> messages = ArrayList();

    JCreator gives me an error in trying to compile it saying it can't find the symbol "List". What am I doing wrong? Sorry, I haven't used lists in ages. Is there something I need to import for it to work?


  2. #2
    Junior Member
    Join Date
    Feb 2012
    Posts
    20
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: Help with initializing Lists

    You know what, I answered my own question actually. I took a look through one of my old textbooks and found out you need to import java.util.*. Also my format for initilization is all wrong too. I should have looked harder before I wasted your time here, I'm sorry.

Similar Threads

  1. Initializing an Array of Objects
    By Destro in forum Object Oriented Programming
    Replies: 1
    Last Post: April 20th, 2012, 06:25 AM
  2. [SOLVED] Not initializing
    By Topflyt in forum What's Wrong With My Code?
    Replies: 9
    Last Post: November 30th, 2011, 03:32 AM
  3. Initializing Variables
    By Tjstretch in forum Java Code Snippets and Tutorials
    Replies: 0
    Last Post: October 29th, 2011, 12:37 PM
  4. Nested-If Problem/ Initializing
    By ak120691 in forum What's Wrong With My Code?
    Replies: 6
    Last Post: March 2nd, 2011, 07:37 PM
  5. initializing a java JApplet
    By j_a_lyons in forum Java Theory & Questions
    Replies: 0
    Last Post: January 8th, 2011, 03:49 PM