click below
click below
Normal Size Small Size show me how
Software Dev Fund 1B
MTA - Software Development Fundamentals 1B
Term | Definition | Analogy |
---|---|---|
primitive data types | very basic kinds of data that are set to specific types and have various sizes; there are 8 of them: byte, short, int, long, float, double, char and boolean; they are considered value types NOT reference types | lego structures are made up of a few types of very basic rectangular, three dimensional pieces of plastic with knobs on top and notches they fit into in the bottom; all combinations of lego projects are made up of lots of these basic blocks |
String | a group of alpha-numeric-punctuation characters; they are considered objects, NOT primitives; they are considered a reference data type | a series of long and short beeps make up a Morse code message as they come in from a telegraph; |
reference data type | considered this because the actual data storage space that contains their variable is a POINTER that refers to another data storage space that holds their value. | when you go to a hotel you get a key; that key is not where you stay and store your luggage; it has the number on it of the room that holds your luggage, and the key indicates where the room is in the hotel and lets you get in |
value data type | considered a primitive value, the data storage space their variable holds actually holds their real value; it is NOT a pointer. | an envelope has an address on it and also holds the actual content the user wants it to; it does not "point" to another location |
method declaration | these almost always start with "public", they tell what type of data they will return (if any) and then have the name of itself; then they may take parameters in the parentheses; parameters must have the data type declared along with a variable name; | if someone starts a business they put out a sign that declares what they do; they announce what they do, what kind of things they work with and what you can expect back from them |
heap memory | this area is used to store: 1. any global variables (objects or primitives) in a class and 2. any local variables that are objects, including Strings; this is a place where its OK if things take longer to access and it's big enough to store many things | a big desk drawer is where you put things that don't have to be found quickly and that can be stored with a lot of other thing |
stack memory | this area is used to store only primitive variables that are declared inside of methods; these things need to be accessed quickly and there is only room for a few | the top of the desk is where you put a few things you are currently working with and that need to be found very quickly |
declaring variables/properties | to do this you have to have the data type and then the name of the variable with a semi-colon on the end | this is like when Tesla announces a new type of car it is going to come out with |
initializing variables/properties | to do this you have to have a properly declared variable and then give it a value; the = sign is used to assign value to a variable; | This is like when Tesla actually manufactures a car and produces a unit that it has announced it will produce |
local scope | this is limited to the inside of a method; any variable declared inside of a method is only visible inside that method; it is NOT a global variable | On a farm some animals have a restricted area they have to stay in, like chickens; pigs don't even know there are chickens on the farm |
global scope | this is visible anywhere inside a class; variables declared outside of any method in a class are usable from within any method. | the farmer and a few animals (like a dog) can be available anywhere, everyone on the farm knows them |
recursion | is when a method has a line of code in it that calls that same method again and again; it is typically used to incrementally solve problems that take some kind of process over and over | if you hold a mirror up to a mirror you keep seeing mirrors inside of mirrors; the thing you put into the view of the mirror causes that view to reflect upon itself |