Basics Flashcards
What three properties makes a program good?
- It works
- easy to modify
- reasonably efficient
What does an ADT stand for?
Abstract Data Type
What does an ADT separate?
Specification and implementation, which improves the reusability
What is specification in this context, and where does it lie?
“What kind of program we are looking at” & in the public external part
What is implementation in this context, and where does it lie?
“How the operations are performed” & in the private internal part
What does unboxing convert between?
Wrapper class(like Integer) to primitives(like int)
What does boxing convert between?
Primitives like double to wrapper class(Double)
What is an exception?
An event that occurs that disrupts flow of execution
What are the general steps of dealing with a potential in exception?
- )method causes exception
- )throws exception
- )handles exception
What are the steps of throwing?
method on call stack where error happens throws exception then can be handled or passed down the call stack for later handling
What types of methods forward the exception?
Ones without an exception handler
What two types of exception handlers are there?
- )try/catch/finally block
2. )throws @ method header with throw new exception object
What three types of exceptions are there?
- unchecked/runtime
- error
- checked
What is the difference between checked and unchecked exceptions?
unchecked are checked at runtime while checked are not
For a sub and super class, which direction is generalization happening?
creating a super class from a sub class is an example of generalization?