Loading...
Uploaded by matt38559 on May 6, 2010
Java Tutorial 8 - Wrapper-Klassen und Autoboxing
Howto & Style
Standard YouTube License
Ok i didn't understand anything you said, but all you germans(if you are german) know english so i have a question.
Pretend you have an ArrayList object named numbers. I want to use the add() method and i do this:
numbers.add(new Integer(5));
What does it mean when i type in "new Integer(5)"? Am I passing the 5 along without creating a new Integer object?
LasagnaIsGood 2 weeks ago
@LasagnaIsGood "new" = create a new object. "Interger(5)" = Call the Interger-Class - his Constructor on pass the value 5.
numbers.add(new Integer(5)) = Create a new Integer Object with the Value 5 and put it into our list. This specific listItem is a Integer Object now.
matt38559 2 days ago
sehr informativ, danke dir :)
igutbuN 1 year ago
Load more suggestions
Ok i didn't understand anything you said, but all you germans(if you are german) know english so i have a question.
Pretend you have an ArrayList object named numbers. I want to use the add() method and i do this:
numbers.add(new Integer(5));
What does it mean when i type in "new Integer(5)"? Am I passing the 5 along without creating a new Integer object?
LasagnaIsGood 2 weeks ago
@LasagnaIsGood "new" = create a new object. "Interger(5)" = Call the Interger-Class - his Constructor on pass the value 5.
numbers.add(new Integer(5)) = Create a new Integer Object with the Value 5 and put it into our list. This specific listItem is a Integer Object now.
matt38559 2 days ago