unknown Object

+1 Black Boy · November 4, 2015
I need a bit help here understanding this.


59: public void itemStateChanged(ItemEvent event) {
60: Object item = event.getItem();
61: if (item == gui.quickpick) {
62: for (int i = 0; i < 6; i++) {
63: int pick;
64: do {
65: pick = (int) Math.floor(Math.random() * 50 + 1);
66: } while (numberGone(pick, gui.numbers, i));
67: gui.numbers[i].setText(“” + pick);
68: }
69: }

at line 60 where the Object comes from?

if you're wondering where this code come from it is taken from the book Sams Teach Yourself Java™ in 24 Hours


Thanks for the help!

Post a Reply

Replies

Oldest  Newest  Rating
+1 Jon Z. · November 5, 2015
Object in Java is any object. In other words every object you can have extends the class Object.
The object in event.getItem() is passed as a parameter.
  • 1

Java / Android Development

107,070 followers
About

Very popular language used to create desktop applications, website applets, and Android apps.

Links
Moderators
Bucky Roberts Administrator