• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/38

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

38 Cards in this Set

  • Front
  • Back

What does OO stand for?

Object Oriented

Is Java considered a Object Oriented language?

Yes.

What does APIE stand for?

Abstraction, Polymorphism, Inheritance, Encapsulation

What is Abstraction?

Abstraction is the concept of exposing only the required essential characteristics and behavior with respect to a context.

What is Inheritance?

It is the principle that child classes inherit properties and methods from the parent classes.

What is Polymorphism?

Polymorphism is the ability of programming languages to present the same interface for differing underlying data types.

What is Encapsulation?

The design principle of hiding only the essential features from the user. This guarantees the intended operation.

What is Static Polymorphism?

Method Overloading.


 


Example: The print method is overloaded to provide different print functionality for the different parameters.

What is Dynamic Polymorphism?

Method Overriding.


 


Example: If the class want to use a different method to compare two object is might use a different procedure in the equals() method than the super class.

What kind of relationship does Class Car have to Class Subaru?

a Is-A relationship. A Subaru IS A car.

What kind of relationship does Class Subaru have to Class Boxer?

a Has-A relationship. A Subaru HAS A boxer engine.

What kind of relationship does Class Engine have to Class Boxer?

A Is-A relationship. A Boxer IS An Engine.

What is an interface?

It is a contract or blueprint on how to build an object, or specific feature of an object.


 


It HAS NO implementation but abstracts that to the defining class.


 


A HashMap implements the Map interface.

What is an Abstract Class?

A contract or blueprint on how to build an object, or specific feature in an object.


 


It HAS implementation in the class but also abstracts some to the defining class.

When Subaru executives give the engineers a steering wheel and pedals and tell them what they must do but not how to do it.


 


Interface or Abstract Class?

Interface since the engineers are free to implement them however the see best as long as each pedal and the steering wheel acomplishes the task they need to.

When Subaru defines how the engine, transmission, powertrain, etc. but allow the end user to define the trim line.


 


Interface or Abstract class?

Abstract Class since there are define default behaviors but the class still requires the user to define some aspects of the class.

What does the keyword Final mean on a method?

That a subclass class cannot override this particular method.

Which is more efficient? A Final method or a non-Final method.

A Final method since it is bound at compile time.

How can you make a class immutable?

By adding the Final keyword.

Why might you want to make a class/object immutable?

 It can be more secure since the object cannot be modified. (Think HashMap.) Also it is thead safe since it cannot be changed and it efficient since it needs no synchronization overhead.

What are the 7 states a thread can be in?

Runnable


Running


Waiting


Sleeping


Blocked on I/O


Blocked on Synchronization


Dead

Define the thread state: Runnable?

It means that it is ready to run but not yet running.

Define the thread state: Running?

It means that the processor is currently executing the thread code

Define the thread state: Waiting?

The thread is currently being blocked in some capacity, like waiting on a resource.

Define the thread state: Sleeping?

A thread has completed its task, or has been forced to enter a passive state by the thread manager.

Define the thread state: Blocked on I/O?

The thread is waiting for another thread or process to complete an I/O task.

Define the thread state: Blocked on Synchronization?

The thread is waiting to acquire a lock on a synchronized collection/method/etc.

Define the thread state: Dead?

The thread has finished execution and been disarded. Usually doesn't happen until the end of the process.

What does DRY stand for in terms of development?

Don't Repeat Yourself.


 


If you have code repeated in a program you should make it a method or class to help improve abstraction.

What should you do with code that may routinely change?

Encapsulize it so that you can have common interfaces between the code and the rest of the program. Then you can change the internal struction without worry about disturbing the other parts of the program.

What is the design principle SOLID?

A set of 5 principles that help create well-thought and implemented OO projects.

What is the S in SOLID?

Single Reponsibility Principle:


 


A method should only ever have one responsiblity

What is the O in SOLID?

Open Closed Principle:


 


You program should be open for extension (new features) but closed to modification.

What is the L in SOLID?

Liskov Substitution Principle:


 


Objects in a program should be replaceable by their subtypes without loss of correctness.

What is the I in SOLID?

Interface Segregation Principle:


 


Many client-specific interfaces are better than one general purpose interface.

What is the D in SOLID?

Dependecy Inversion Principle:


 


You need to depend on abstraction not on concrete implementations.

What happens if you call the start() method on a thread?

It will run the new thread and execute the code in the run() method of the thread class.

What happens if you call the run() method on a thread?

It will execute the run() method in the main thread and not run a new thread.