64

Made a list of all my friends in Java.

then I run:
list.get(0);

I get: Index out of bound exception.

What is the problem, send help

Comments
  • 2
    Added to favorites, made me laugh 😁
  • 2
    Found the problem; java.
  • 0
    @GodlikeBlock so the same implementation of the same problem with another language will not rise an error? 🤔🤔
  • 1
    @lazyDev no, because then people will be your friends and you have entries in the frieds list
  • 0
    @GodlikeBlock okay, I see no problem specific to Java here
  • 0
    Maybe other people get an exception. Make sure your friend list implementation is not immutable and there are interfaces.
  • 0
    are you sure thats your friend list and not mine?
  • 0
    try this:
    list.get(-1);
  • 1
    @Supersebi3 let's concatenate our lists and try again !
  • 0
    @lazyDev @Supersebi3 i think two concatenated empty lists will still be empty :D
    But at least u could add each other ^^
Add Comment