unit1/2 java test

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/38

flashcard set

Earn XP

Description and Tags

studying for unit1/2 test

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

39 Terms

1
New cards

top down development

A software development approach where the overall structure and design of a system is planned first before implementing the specific details. It starts with a broad view and gradually breaks down into smaller components.

2
New cards

procedural abstraction

using methods to define tasks, for example, the hurdle landDown(), passBaton() etc.

3
New cards

call

calling a method, it consists of a method name followed by parenthesis

4
New cards

method declaration

methods consist of a declaration and a body, where…
- declaration includes its access level, return type, name, and params.
- body consists of the statements that implement the method

5
New cards

access level

determines if the other classes can call the method by seeing if the access level is public, private, or protected

6
New cards

access modifier

keywords in the declaration of a method that determines the access level of a method

7
New cards

visibility

the access level of a method can be though of as its visibility

8
New cards

class method

if the keyword static is used, its a class method.
- class methods cant be called from the class itself
- methods that are not class methods must be called from an instantiated object of that class

9
New cards

void

indicates that the method is not going to return a value.

10
New cards
11
New cards

local scope

methods can have their own set of variables, constants, and objects

  • variables, constants, and object declarations INSIDE of the body of a method have a scope (limited accessibility)

12
New cards

argument

value passed to a method

13
New cards

method overloading

when more than one kind of argument can be passed into a method of the same name as another method

14
New cards

return statement

methods can return value, they can only return ONE value. they must also state their return type in the method declaration
- ex: public static int returnNumber(int x){

//blah blah

}

15
New cards

Documenting methods

methods should have pre and post conditions.

Preconditions are the conditions or assumptions that must be true before a method is executed. They define the state of the system or the inputs that the method expects to work correctly.

Preconditions ensure that the method is called in a valid context.

Postconditions are the conditions that must be true after a method has executed successfully. They define the expected state of the system or the outputs that the method should produce.

Postconditions ensure that the method has achieved its intended purpose.

16
New cards

boundary value

data that is just inside or outside the range of valid values

17
New cards

state behaviour

state of object that refers to the data it stores, behaviour refers to the the action and communication it provides

18
New cards

encapsulation

protecting an objects data from code outside the class

19
New cards

client code

refers to an application that uses 1 or more classes , client can access methods of the class, but cannot directly access the data defined in the class. reinforces the fact that the state of an object can only be changed through its behaviour

20
New cards

class declaration, body

class dec: includes the access level, key word class, class name

body: includes variables, constructors, and methods

21
New cards

constructor member

used to initialize variables in a class

22
New cards

members

variables and methods are called members of a class

23
New cards

accessor method vs modifier method

used to determine value of a variable = accessor method
used to set value of a variable = modifier method

24
New cards

helper method

called from within a class by other methods, they are used to help complete a task, and have access level private

25
New cards

constructors

automatically executed when an object is instantiated

dont have a return type

always have the same name as the class

26
New cards

overloading constructors

used to provide more options when instantiating an object

27
New cards

instance variables/methods

ever object has a copy of its variables called instance variables

accessor and modifier methods are instance methods because they change the state of an object

they must be called by an instance of a class

28
New cards

class variable/methods

each class has only one copy maintained for all objects to refer to

class methods are declared by the keyword static, and can be called by the class itself

29
New cards

object casting

equals() method requires an object param

30
New cards

ClassCastException

when an object variable is cast with an incompatible class

31
New cards

modular

an application that uses components that are seperately written and maintained

32
New cards

inhertiance

a class that inherits the properties and behaviors of another class, promoting code reuse and creating a hierarchical relationship between classes.

33
New cards

polymorphism

objects have the ability to assume different types based on inheritance - subclass overriding a superclass method

34
New cards

abstract

use keyword “abstract”, cannot be instantiated because they do NOT represent objects
they describe the general details and actions of type of object

35
New cards

abstract method

declared with the keyword abstract, but be implemented in its subclass

36
New cards

interface

an interface specifies the behavior of a class by providing an abstract type.
is not part of hierarchy

37
New cards

Interface Comparable

compareToObject(), returns 0 if obect is same, negative if its less than, and positive if its mroe than

38
New cards
39
New cards