DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2003
    Posts
    3

    NullPointerException

    sorry to bother u guys again but....
    I have the following code

    public static void sortId() {
    int passCount;
    int placeCount;
    int minIndex;

    Video temp = new Video();
    for(passCount = 0; passCount < videos.length ; passCount++){
    minIndex = passCount;
    for(placeCount = passCount + 1; placeCount < videos.length; placeCount++){
    if((videos[placeCount].getVideoId()) < (videos[minIndex].getVideoId())){
    minIndex = placeCount;
    System.out.println(temp);
    }
    temp = videos[passCount];
    System.out.println(temp);
    videos[passCount] = videos[minIndex];
    videos[minIndex] = temp;

    }
    }
    }

    videos is an array
    but somehow when I run this method...it gives me NullPointerException...can someone help me plz....

  2. #2
    Join Date
    Mar 2003
    Posts
    834
    Can you please post the stack trace.
    ArchAngel.
    O:-)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links