Interview

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

Abstraction

"A contract". To exist as an idea instead of physically. Cannot be instantiated.

Inheritance

"Is a" relationship. The ability of a class to inherit properties and methods of a superclass. Allows for high code reuse.

Explain what object reflection is in Java and why it is useful.

???

Abstract Class

A class that cannot be instantiated, only implemented.

Generic

A function can take in a variable of a generic type such that the function does not have to be rewritten to handle different types. Ex. The List interface is a generic function that can take in multiple types, it's how you can have List<String> and List<Integer> both use the List class.

Abstract Method

A method without implementation that must be defined in a subclass.

Tell Me About Yourself

AZ 2000 ASU CS Web Dev Projects Current Intern - Masters Program Looking For

4 Components of Object Oriented Programming

Abstraction Polymorphism Inheritance Encapsulation

Explain the differences between TreeMap, HashMap, and LinkedHashMap.

All use lookup by key. TreeMap - O(log n) lookup and insertion, but can go through in sorted order if needed. (Must implement comparable). HashMap - O(1) lookup and insertion. Keys ordered arbitrarily. LinkedHashMap - O(1) lookup and insertion. Keys ordered by insertion order.

In terms of inheritance, what is the effect of keeping a constructor private?

By keeping the constructor of a class private, you can only access the constructor if you have access to the classes private methods (or if the public method is static). Class A can be inherited, but only by its own or its parents inner classes.

Encapsulation

Data Encapsulation - Hiding data behind access modifiers. _ Encapsulation -

Leadership Experience

Enfuego - Team Lead IBM - Sandbox Project

Strengths

Fast Learner Team Player Communication Dependable

Challenges Faced

Finish MVP with half a team.

Example of when LinkedHashMap would be best.

If you needed O(1) insertion and lookup, but you also needed to access the keys by order of insertion. Ex. Caching items, needing to get rid of the oldest items.

Example of when HashMap would be best.

If you needed O(1) insertion and lookup.

Example of when TreeMap would be best.

If you needed to print out keys in order. Ex. Given a name, you could output the next 10 people, would be useful for a "more" function.

Object Oriented Programming

Modeling software similar to real world objects with properties and relationships to other objects.

Weaknesses

Task Organization Making Things Perfect

Polymorphism

The ability of an object to take on multiple different forms. Functions that take in a certain type of object as a parameter can also take in subclasses of that object, because all the methods of the parent object must exist on the child object.

Does the finally block get executed if we insert a return statement inside the try block of a try-catch-finally?

Yes (Except when a thread gets killed or JVM exits in the try statement.)

What is the difference between final, finally, and finalize?

final - variable: makes it immutable, function: makes it unable to be overrode class: makes it unable to be subclassed. finally - The last block in a try-catch-finally statement that runs no matter what while handling exceptions. finalize - The method that gets called on an object right before it is picked up by the garbage collector. (Can be overridden to add custom functionality like closing a file).


Ensembles d'études connexes

Quiz: Module 03 Threats and Attacks on Endpoints

View Set

*possible help/practice exams 2*

View Set

SIMULATED TEST QUESTIONS - PRACTICE EXAM 3 - (please feel free to submit edits/corrections to Mike!)

View Set