OOP Flashcards

1
Q

What is a class?

A

A class is basically a specification or a blueprint or a design of how objects are and behave. Properties and actions

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

T or F: Constructor methods always have the same name as class name?

A

True

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

What is the main method?

A

Entry point for all Java applicatios and code is executed sequentially line by line

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

What is ‘this’ in java?

A

It is a variable in Java. It points to the current object.

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

When are objects created?

A

Objects exist during application runtime. How do the objects behave during application runtime?

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

Why are methods important in Java?

A

All Java applications are ran through methods. Blocks of code that are named

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

What are the two memory locations for your Java application to be ran successfully?

A

One is the stack and the other is the heap

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

What is the stack?

A

Memory location that can hold frames. It maintains method invocations and holds local variables (primitive data types)

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

What gets assigned to a reference variable?

A

The memory addres in the Heap where the object resides

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

What is garbage collection?

A

A process where any objects that don’t have a variable pointing to them.

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

What is an instance variable?

A

Used to maintain state for a particular object

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

What is an abstract data type? What is a data type? What is a primitive data type?

A

A data type is simply just a set of values and operations you can run on those values. A premitive data type is predefined by the Java Language as a reserved keyword.

Abstract data type is capable of handling more advanced functionality using data and running operations. You can create through a class and store data in it or invoke operations to change the data. “Trustworthy containers capable of doing things with data”..it’s meant to be hidden from the client that uses it

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