logo

AP Computer Science A: Unit 1: Object Oriented Programming

19 Pages3629 Words36 Views
   

Added on  2022-10-20

AP Computer Science A: Unit 1: Object Oriented Programming

   Added on 2022-10-20

ShareRelated Documents
Jocelyne Suerte
AP Computer Science A
Unit 1: Object Oriented Programming
Object-Oriented Programming: An approach to creating and using models of physical or
imagined objects
Compile: To translate a computer program from a high level language into another language
stats
Class: A user-definded blueprint of attributes and behaviors of an object
Object: An instance of a class
Attribute: A characteristic of an object
Behavior: An action that an object can perform
Each method is followed by parentheses()
Each method is written on its own line
Correct Syntax: art.paint(“blue”);
Incorrect Syntax: art.Paint
Software: A set of specific instructions that enables a computer to perform a task
Method: A named set of instructions to perform a task
Syntax: Rules for how code must be entered for a computer to understand
Case-Sensitive: Differentiating between lower and uppercase letters
Statement: Instructions that tell Java what to do\
Syntax Error: Mistakes in the code, such as typos and misspellings, that do not follow the syntax
rules of the programming language
AP Computer Science A: Unit 1: Object Oriented Programming_1
In if statements whatever is inside the parentheses is a conditional
An algorithm is a set of instructions to solve a problem or accomplish a task.
Bug: An error in the code
Boolean: A data type that can either be true or false
Conditional Statement: A statement that only runs under certain conditions
Algorithm: A set of instructions to solve a problem or accomplish a task
Debugging: Finding and fixing problems in an algorithm or program
Logic Error: When the code runs but does not do what was expected
Class & Object- ex: capeColor- blue, superPower- flying
Constructor- a block of code in a class that tells the computer how to create a new object
Constructor Signature- the first line of the constructor which includes the constructor name and
lists the attributes of the object that can be specified when the object is initialized
Initialize- create a new object with a specific name and a set of starting attributes
Actual Parameter- the value given to an attribute when initializing and object
Formal Parameter- the name of the attributes in the constructor signature
AP Computer Science A: Unit 1: Object Oriented Programming_2
Syntax: Rules for how code must be entered for a computer to understand
Syntax Error: Mistakes in the code, such as typos and misspelling, that do not follow the syntax
rules of the programming language
Method: A named set of instructions to perform a task
Object: an instance of class
Class: A user-defined blueprint from which objects are created
Debugging: Finding and fixing problems in an algorithm or program
Boolean: A data type that can be either true or false
Conditional Statement: A statement that only tuns under certain conditions
Compile: To translate human-readable source code into computer-executable machine code
Constructor: A block of code in the class that tells the computer how to create a new object
Initialize: Create a new object with a specific name and starting values for its attributes
Constructor Signature: The first line of the constructor which includes the constructor name and
lists the object’s attributes that can be specified when it’s initialized
Formal Parameter: The name of the attribute in the constructor signature
Actual Parameter: The value given to an attribute when initializing an object
Efficiency: Getting the best outcome with the least amount of waste
Always need two brackets at the end of the code, to define the class and object.
Subclass= truck, more specific
Super class= vehicle, broad
In Java, we can use ! to represent "not".
AP Computer Science A: Unit 1: Object Oriented Programming_3
!false reads "not false"
!true reads "not true"
! reads as “not”.
Example: If it’s emily.(!canPaint), it means emily can’t paint
Inheritance: An object-oriented programming principle where a subclass inherits the instance
variables and methods of a superclass
Ex of an Inheritance: superclass- Cookie subclass- SugarCookie
Subclass: A class that inherits attributes and behaviors from a superclass
Superclass: A class from which subclasses can be created
Class Header: Consists of the keyword class and the name of the class
An edge case is a situation in a program that produces a different outcome and requires special
error handling.
Ex of edge case is, painter cannot move because of an obstacle
Psuedocode- A written description of what the code should do (A simple way of writing an
AP Computer Science A: Unit 1: Object Oriented Programming_4

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Lecture on Problem Solving & Flowcharts
|36
|1691
|24