Define the following and give an example of each.
primitive data types (at least 5) - pre-defined java information
( int, boolean, double, char, float, long, byte, etc.) |
object - The "thing" created in the computer's
memory that is described by a class. Objects contain field (or
instance)
variables and methods. |
class - The program that is written in Java that describes
objects by declaring and instantiating variables and using (or
calling) methods. |
identifier - The name a programmer chooses to give to a class,
variable, or method. Examples: PetRock, side,
main() |
instance variable - An identifier that refers to a memory location
that holds data/information (i.e. a noun or ingredient)/ |
declaration - When a programmer gives a variable a name and
a type (ex. String name). Also, a method is declared when it is
given a method header (name) and its body. Example: public void
eat {...} |
instantiation - A programmer uses the reserved word "new" with
a constructor to create an object in the computers memory. Example:
new CyberPet(); |
assignment -A programmer uses the "=" to
give a variable a value (ex. x = 5;) |
method - A function, action, verb, or set of instructions that
use and manipulates variables. |
condition - A test that returns either True or False, usually
inside an "if" or "for" statement
and in parenthesis. Ex. if (score > 90)... |
statement - A single java command that ends in a semicolon
Ex. System.out.println("hello"); |
interface - Anything that is public in
a class. Usually the methods of a class. Can be accessed outside
the class. As opposed
to private which cannot be accessed
outside the class. Use of private variables
is called "information hiding." |
qualified name - Using the dot-notation to go inside an object
to access the public features (methods). Ex: pet1.eat() |