Creating Uruk Hais
From Huben's Wiki
(→What Is An Object) |
|||
Line 82: | Line 82: | ||
String s = "example string"; | String s = "example string"; | ||
</pre> | </pre> | ||
− | a string object containing the information " | + | a string object containing the information "example string" is created somewhere in computer memory, and the variable 's' is set to that location. Variables storing locations of objects can be called '''pointers''' or '''references'''. We can say they ''point to''' the object or '''refer to''' the object. The type of those variables is the type of their object's class. |
# What does 's' have in it? | # What does 's' have in it? |