Shared Flashcard Set

Details

CS 1150 Quiz #3
Chapters 8-13
16
Computer Science
Undergraduate 2
12/04/2011

Additional Computer Science Flashcards

 


 

Cards

Term
Constructors
Definition
Methods which are invoked to create a new object. Do not have a return type (not even void).
Term
Static variable
Definition
Store values for the variables in a common memory location, so if one object changes the value of a static variable, all objects of the same class are affected. Use if you want all the instances of a class to share data.
Term
Static methods
Definition
Can be called without creating an instance of the class.
Term
Constants in a class
Definition
Are shared by all objects of the class and should be declared final static.
Term
private
Definition
makes methods and data fields accessible only from within its own class. Only applies to members of a class, not classes themselves.
Term
Data field encapsulation
Definition
Declaring the data fields private (using the private modifier) in order to prevent direct modifications of the data fields.
Term
Accessor
Definition
To make a private data field accessible provide a get method to return its value. public static
Term
Mutator
Definition
To enable a private data field to be updated provide a set method to set a new value. public void
Term
Immutable Strings
Definition
A string object whose contents cannot be changed.
Term
Interned Strings
Definition
When two strings with different names have the same contents.
Term
Conversion between Strings and Arrays
Definition
char[] chars = "String".toCharArray();
Term
Converting Characters and Numbers to Strings
Definition
String.valueOf(5.44);
Term
Array of Objects
Definition
Circle[] circleArray = new Circle[10];
for loop {
circleArray[i] = new Circle();
Term
StringBuilder/StringBuffer
Definition
Exactly like a String except you can add insert, or append new contents into them.
Term
Immutable object
Definition
An object whose contents cannot be changed once it's created.
Term
Immutable Class
Definition
All data fields must be private, no mutator methods, no accessor method that returns a reference to a data field that is mutable.
Supporting users have an ad free experience!