Java Fundamentals Flashcards
Class
A programmer-defined data type; a template for creating objects.
Object
An instance of a class
Variable
A user defined memory location. This is akin to referring to a physical location as Empire State Building instead of 20 W 34th St, New York, NY 10001.
Methods
The actions performed by an object. They are comprised of a sequence of statements that has a name, may have parameter variables, and may return a value. A method can be invoked any number of times, with different values for its parameter variables.
Initialize
Set a variable to a well-defined value when it is created.
Assignment
Placing a new value into a variable.
Case sensitive
Distinguishing upper- and lowercase characters. Java is a case sensitive language.
Reserved words
A word that has a special meaning in a programming language and therefore cannot be used as a name by the programmer.
Comments
An explanation to help the human reader understand a section of a program; ignored by the compiler.
There are two main types:
-
JavaDoc comments - These can be read by someone separately from the code (can also be used for multi-line comments) and are expected to be present before each Class definition and method header.
/**
* This is a JavaDoc comment
*/ -
Internal comments - These are only read in the code and are typically used for single line comments.
// This is an internal comment
uninitialized variable
A variable that has not been set to a particular value. In Java, using an uninitialized local variable is a syntax error.
Public interface
The features (methods, variables, and nested types) of a class that are accessible to all clients.
argument
A value supplied in a method call, or one of the values combined by an operator.
void
A reserved word indicating no return type or an unknown type.
Overloading
Giving more than one meaning to a method name.
Accessor method
A method that accesses an object and returns some information about it, but does not change it. For example, the length method of the String class is an accessor method since it returns the length of the string without modifying it. Similarly, “getter” methods are also accessor methods since they return information without changing any data.