OOP Flashcards
What is a class?
A class is basically a specification or a blueprint or a design of how objects are and behave. Properties and actions
T or F: Constructor methods always have the same name as class name?
True
What is the main method?
Entry point for all Java applicatios and code is executed sequentially line by line
What is ‘this’ in java?
It is a variable in Java. It points to the current object.
When are objects created?
Objects exist during application runtime. How do the objects behave during application runtime?
Why are methods important in Java?
All Java applications are ran through methods. Blocks of code that are named
What are the two memory locations for your Java application to be ran successfully?
One is the stack and the other is the heap
What is the stack?
Memory location that can hold frames. It maintains method invocations and holds local variables (primitive data types)
What gets assigned to a reference variable?
The memory addres in the Heap where the object resides
What is garbage collection?
A process where any objects that don’t have a variable pointing to them.
What is an instance variable?
Used to maintain state for a particular object
What is an abstract data type? What is a data type? What is a primitive data type?
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