Chapter 1 Flashcards

1
Q

Objects

A
  • Created from classes
  • represent “things” from the real world or from some problem domain
  • represents individual instances of the class
  • ie. if class is car, objects are racecar, limousine etc
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Classes

A
  • represents all objects of a kind
  • uppercase
  • ie. car
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Instance

A
  • a particular object
  • refer to objects as instances when we want to emphasize that they are of a particular class
  • ie. the object is an instance of the class car
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Objects naming convention

A

Lowercase

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Objects have___ which can be invoked, and called what in Java?

A

-operations
-methods

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What do methods have to pass additional info needed to execute?

A

parameters

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Data type

A

specifies what kind of data can be passed to the parameter
-integer (int) specifies whole numbers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

An object has attributes which are?

A

Values stored in fields

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

The class defines_________ but each object_________

A

-what fields an object has
-stores its own set of values (the state of the object)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

State

A

-The set of values of all attributes defining an object
-inspect in java

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Each class has a source code ___________________

A

-(java code) associated with it that defines its details (fields and methods)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Compilation

A

-java is a high level language
-but computers can only interpret low level machine code
-compilers translate programming code into machine code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What return type returns a value?

A

non-void return type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Signature

A

-The method name and the parameter types of a method
-it provides the info needed to invoke the method
ie.
void moveHorizontal (int distance)
signature = moveHorizontal(int)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Header

A

-provides info about the method in question
ie.
void moveHorizontal (int distance)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

String type

A

indicates that a section of text (a word or sentence) is expected.
-always enclosed W/I double quotes.

17
Q

Multiple instances

A

Many similar objects can be created from a single class

18
Q

Fields

A

Object attributes, when some methods are called the state of the object or attributes changes.
ie. moveLeft changes the xPosition attribute

19
Q

Boolean

A

A type that can represent 2 values: true or false

20
Q

Result

A

Methods may return info about an object via a return value.
String getName()
string is the return type

21
Q

Which return type doesn’t return a value

A

void as in:
void changeName (String replacementName)

22
Q

What happens when you specify a color that is not known in Java?

A

it turns black

23
Q

What happens when you enter a string without the quotes in Java?

A

Causes an error
ie:
(yellow is entered)
Error: cannot find symbol - variable yellow

24
Q

Method calling

A

Objects can communicate by calling each other’s methods

25
Q

Which are considered programming paradigms?
1. Java programming
2. Python programming
3. Object oriented programming
4. Event driven programming
5. Procedural programming
6. Pseudo programming
7. Assembly programming
8. Constructal programming
9. Artificial intelligence programming
10. Functional programming

A

OOP
Procedural
Assembly
Functional

26
Q

Java is best know for supporting which programming paradigm?

A

OOP

27
Q

T or F: Java objects model objects from a problem domain

A

True