Shared Flashcard Set

Details

Java 2
Java Exam Review
8
Computer Science
Undergraduate 3
05/31/2009

Additional Computer Science Flashcards

 


 

Cards

Term
Encapsulation
Definition
is the hiding of the internal mechanisms and data structures of a software component behind a defined interface
Term
setters and getters
Definition
A getter is a method that gets the value of a specific property. A setter is a method that sets the value of a specific property.
Term
toString() method
Definition
method that formats the object's data in a sensible way and returns a string.
Term
constructors
Definition
It initializes the class variables to default values, It then calls the super class constructor , It then initializes the class variables to the specified values, It then executes the body of the constructor.
Term
Static keyword
Definition
static refers to a method or variable that is not attached to a particular object, but rather to the class as a whole.
Term
tester class
Definition
Class-level testing exercises the interactions between the methods in a class or a small cluster of classes.
Term
passing primitives to methods versus passing reference variables to methods
Definition
Primitive arguments, such as an int or a double, are passed into methods by value. This means that any changes to the values of the parameters exist only within the scope of the method. When the method returns, the parameters are gone and any changes to them are lost.
Reference data type parameters, such as objects, are also passed into methods by value. This means that when the method returns, the passed-in reference still references the same object as before. However, the values of the object's fields can be changed in the method, if they have the proper access level.
Term
Why is main static and every method in main static?
Definition
The static modifier means that it does not have to be instantiated to use it. Before a program runs there are technically no objects created yet, so the main method, which is the entry point for the application must be labeled static to tell the JVM that the method can be used without having first to create an instance of that class.
Supporting users have an ad free experience!