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 4 of 4

Thread: What kind of object instantiation is this?

  1. #1
    Junior Member
    Join Date
    Jun 2011
    Posts
    26
    My Mood
    Fine
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Question What kind of object instantiation is this?

    Hi!

    I'm new to Java and I was reading up about SwingWorker when I came across this code.

    SwingWorker worker = new SwingWorker<ImageIcon[], Void>() {
        @Override
        public ImageIcon[] doInBackground() {
            final ImageIcon[] innerImgs = new ImageIcon[nimgs];
            for (int i = 0; i < nimgs; i++) {
                innerImgs[i] = loadImage(i+1);
            }
            return innerImgs;
        }

    What is this new <> stuff? Please tell me what it's called so I can learn about it. Or give me a link to an online tutorial.
    Last edited by Lord Voldemort; July 6th, 2011 at 01:22 AM. Reason: grammatical error


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,144
    Thanks
    48
    Thanked 2,158 Times in 2,131 Posts

    Default Re: What kind of object instantiation is this?

    this new <> stuff?
    That's Generics.
    Go to this site: The Really Big Index
    and do a Find for Generics

  3. #3
    Junior Member
    Join Date
    Jun 2011
    Posts
    26
    My Mood
    Fine
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default Re: What kind of object instantiation is this?

    I found this tutorial on Generics.
    Thanks Norm.

  4. #4
    Forum old-timer
    Join Date
    Nov 2008
    Location
    Faversham, Kent, UK
    Posts
    471
    My Mood
    Mellow
    Thanks
    4
    Thanked 58 Times in 54 Posts

    Default Re: What kind of object instantiation is this?

    This is a good one: Jenkov's Java Generics Tutorial

Similar Threads

  1. ActionServlet Instantiation
    By tcstcs in forum Web Frameworks
    Replies: 0
    Last Post: April 5th, 2011, 06:12 AM
  2. Instantiation from within Methods
    By John Davies in forum Object Oriented Programming
    Replies: 2
    Last Post: March 10th, 2011, 03:39 PM
  3. Generics and Dynamic Instantiation Problem
    By marcosmarcos in forum Collections and Generics
    Replies: 2
    Last Post: March 4th, 2011, 01:32 PM
  4. sync two diffrent kind of threads?
    By adamruss in forum Threads
    Replies: 1
    Last Post: January 10th, 2010, 07:59 PM
  5. Which collection is best to do mathematical operation on it?
    By Sterzerkmode in forum Java Theory & Questions
    Replies: 1
    Last Post: May 7th, 2009, 04:48 AM