TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
said7effo
NA
5
0
bug in ArrayLists?
Nov 14 2003 12:58 PM
Greetings, I spent 10 minutes figuring out the weirdest bug. I declared an arraylist in a class without initializing it. In the constructor i did the fatal mistake of redeclaring the arraylist instead of initializing it i.e: ArrayList myArrayList_ = new ArrayList(); instead of myArrayList_ = new ArrayList(); A class function uses the myArrayList_ private object. When it tried to add new elements to the arraylist, no exceptions were thrown, the windows forms thread continued execution as if i didn't do the call to the method of the class. And obviously, the object containing the arraylist wasn't initialized as intended. Does anyone have an idea how adding elements to an unitialized arraylist doesn't generate a runtime exception? (btw, the function call that adds items to the arraylist was done through a custom data load event). Thanks
Reply
Answers (
1
)
How to Use COM DLL in .NET
how to transfer files