Author Topic: Ctrl + V game.  (Read 570652 times)


don't have any thing i will come back later >__>


drjava-eclipse.jar


That's actually a file but whatever.

about time for a change?

Science: p.834 17-25


Language Arts: Studi for Seedfolks test.



Spanish: :D

 

Geography: MI Notes p. 352-353; MI Notes p. 354-355



Math: 8.5 textbook
1-22, 30-33 all

:D if none/done :D
(MY weekend homework DX DX DX DX)

Halo Wars (inkl. Preorder Code)
Xbox 360 (PAL)
 Preis: SFr. 95.00
 




 
Genre: Strategie
Versandtermin: 26. Februar 2009
Ladenverkauf ab: 27. Februar 2009 


Interacting with an object (i.e. using capabilities)

Next, we will create an Ant object and place the Ant in the Terrarium.  To create an Ant object we
write:

new chapter1.Ant()

However, this does not appear to do much: nothing changes in the Terrarium window.  The DrJava
interactions pane does display some new information, and in fact an Ant object was created.    However,
there is no connection between this Ant object the Terrarium object.   In our goofy example, the ant
needs to be placed into the terrarium.  Once in the terrarium, it will appear on-screen.
To add the Ant object to the Terrarium object we type:

new chapter1.Terrarium().add(new chapter1.Ant())

This is a lot of typing!  What does it do? We know that

new chapter1.Terrarium()

creates a new Terrarium object.   Similarly,

new chapter1.Ant()

creates a new Ant object.  Remember that new says we want to create a new object, chapter1.Ant
says what kind of object we want to create, and () says we want to create a default (plain vanilla)
object.  The .add(…)part of the expression is something new.    It says to use one of the capabilities of
the terrarium.  We say that add is a method which we are invoking on the Terrarium object, and we are
sending along the new Ant object as an argument in the method call.    Notice that new chapter1.Ant()
appears inside a set of parentheses, which are part of the method call.
On screen we see something like this:

                                                Page
                                                15

rofl @ the related videos





तो केकड़े की तरह मैं झुंड U