Week 3 Flashcards

1
Q

One reason Java is known as an extensible language

A

You can declare new classes as needed

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

Each class declaration that begins with the access modifier ______ must be stored in a file that has the same name as the class, and ends with the .java file extension

A

public

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

Every class declaration contains the keyword _____ followed immediately by the classes name

A

class

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

_____, _______ and ________ names are identifiers

A

class, method, and variable

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

An object has attributes implemented as ________ variables that are carried with it throughout its lifetime

A

instance

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

Instance variables exist ______ methods are called on an object, while the methods are _________, and after the methods complete _________

A

before, executing, execution

In other words instance variables exist before during after a method is called on an object

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

In relation to classes and methods, where are instance variables declared?

A

Inside a class, outside the bodies of the methods

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

Each object (instance) of the class has its ___ ____ of each of the class’ instance variables

A

own copy

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

Instance variables should be listed ____ in the body of the class

A

first

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

What can access members of a class that are declared private?

A

The public methods of the class

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

Parameters are declared in a _____-_________ parameter list, which is inside the parentheses following the method name

A

comma-separated

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

Every parameter must specify a ____ followed by a ________ name

A

type, variable name

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

Vars declared in the body of a particular method are _____ variables

A

local

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

When a method terminates, what happens to the values of the local variables?

A

They’re lost

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

What keyword is used if a method will not return any information?

A

Void

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

If a method does not require any parameters to perform its task, what will follow the method name?

A

Empty parentheses

17
Q

When a method specifies a return type other than void, what must happen?

A

It must return a result to its calling

18
Q

Do getters and setters have to begin with get or set?

A

No, but it is the recommended convention.

19
Q

A class instance creation expression begins with ___ and creates a ___ ______

A

new, new object

20
Q

___________ are called implicitly by the new operator to initialize an object’s instance variables at the time the object is created

A

Constructors

21
Q

T/F - Local variables are automatically initalized

A

False

22
Q

When the instance variables initial value is not specified, what is the value it is given called?

A

A default value

23
Q

What is the default vale of a String?

A

null

24
Q

A method call supplies values called _________ whereas the method that is called has __________

A

arguments, parameters