Change Contents of the Bubble
View this PageEdit this PageUploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

Exam 2 Review Fall2007:Java Keywords Faceoff

Post your questions here.
Back to Exam Review 2

Here's what I know, feel free to add to the list guys. There's no penalty for putting answers on here and it helps everyone out.

static v. nonstatic (instance) - static methods take in arguments instead of variables.
for example (these are not real methods)
myMethod1(7) is a static method because it takes in an argument, 7, something that never changes (you can't say 7 = 8 or something)
myMethod2(someName) is a nonstatic instance variable because it depends on what you set someName (someName can equal 7, "Bob",etc. it's not constant)


linked list v. array - these are two different types of structures, except linked lists are dynamic and arrays are static. With an array, you must define the number of elements in it as soon as you create it (fixed length). With a linked list, you can easily add and remove elements (dynamic length).

null v. void - this one's kind of hard to explain. First, void means Do Not Return Anything. null means there is something deemed as the return, it just happens to be a nonvalue, nothing. Say you type

LLNode node = null

There IS a LLNode node declared, it just happens to be null (no value,no phrase, no string, no nothing)
It's kind of like an empty placeholder in this sense.

That's all I got, add to the page people!




extends vs. implements:
extends-automatically has a class inherit functionality from a superclass
implements-forces a class to require functionality from an interface



Link to this Page