This week's book giveaway is in the Server-Side JavaScript and NodeJS forum.
We're giving away four copies of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques and have Mario Casciaro & Luciano Mammino on-line!
See this thread for details.
Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!

Hosam Shahin

Greenhorn
+ Follow
since Dec 21, 2009
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Hosam Shahin

Useful information can be found Here
Since I'm new to Java world. I already know the stack and heap, but I don't know much about "memory data section" mentioned in Here. So if you can shade some light on this or give me references to review.

Regards
Many thanks. although it was not clear 100% but it was really helpfull.
Kathy and Bert SCJP page 682
"You learned why method-local inner classes cannot
use non-final local variables declared within the method—the inner class instance
may outlive the stack frame, so the local variable might vanish while the inner class
object is still alive"

As far as my understanding final vars cannot be changed but it will also vanish when the method completes. then how method-local inner classes can use them?!!

Regards
Perfect ... congratz
11 years ago
As per the API:

Object get(int index)
Returns the element at the specified position in this list.

in this case index should range from 0 to 2 since your ArrayList contains only 3 elements. but you are trying to get the 7th. this is why outofindex exception happen.

HTH