

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Instance variables: Declared inside the class but outside of the method, block or constructor. If not initialized, the default value is 0. Variables are created when an instance of the class is created and destroyed when it is destroyed.
Local Variables: Declared and initialized inside the body of the method, block, or constructor. It has access only within the method in which it is declared and is destroyed later from the block or when the function call is returned. Static Variable: Declared using a “static” keyword. It cannot be local. Variables are created to create a single copy in the memory shared among all objects at a class level.
Initializes an object on creation, they have the same name as the class, they do not have a return type, and it cannot be static, final or abstract.
An array is a group of like-type variables referred by a common name, having continuous memory. Primitive value objects are stored in an array. It provides code optimization since we can sort data efficiently and also access it randomly. The only flaw is that we can have a fixed-size element in an array.
are connected. Tight Coupling: One or more methods are interdependent on each other. Loose Coupling: one or more methods are not interdependent.
brackets ( {} ) with private access modifier but outside of any method, has class scope. As a result, these variables can be used everywhere in the class, but not outside of it:
method or loop will only be valid inside of the same method or loop.
switch is limited to the block it was declared within, a block in this context is code inside the { and }
Classes are represented using a rectangle with SQUARE edges. Objects are represented using ROUNDED edged rectangles Variables are represented by a small square box, enter ref into box for references and null if empty.
methods in a program and is important for keeping track of the execution of the program and allowing methods to call and return from each other
lifetime of a program, it is where memory is allocated for new objects and deallocated when they are no longer needed. The heap is typically much larger than the stack, and it is where garbage collection takes place.
Oval: Indicate start and end points Parallelograms: Designate input or output operations Rectangle: Depicts a process such as a math calculation or a variable assignment Diamond: True/false statement being tested in a decision symbol
Algorithms: An algorithm is a solution to a problem, as a sequence of steps initiated with one starting point, and finishing at one exit point. Computer programs are algorithms. Variable: A name (identifier) used by a programmer to refer to a part of the computer's memory to store and retrieve data. [Modifiers] [Data Type] [Identifier][Assignment Operator][Initial Value];
contains properties and behaviors.
private Scanner keyboard = new Scanner(System.in);
Tells Java to exit a method immediately and must be the last statement in the method for non-void methods.
Method overloading occurs when two methods have the same name, but different signatures. (Same for Constructors)
Magic numbers are literal values within computer code that have additional meaning outside of their value.
A loop control variable is a variable that is part of the boolean expression controlling the loop.
how a method works.
accomplish the method's purpose.
‘Git init’ Initialize a new local git repository ‘Git add’ Add files to the staging area ‘Git commit’ Create a new commit with the files that are in staging