Method - Describe boolean equals(Object o)
indicates whether some other object is “equal to” this one
Method - Describe Object clone()
creates and returns a copy of the object
Method - Describe void finalize()
called by the garbage collector on an object when garbage collection determines that there are no more references to the object
Method - Describe Class< ? > getClass()
returns the runtime class of the object
Method - Describe int hashCode()
returns a hash code value for the object
Method - Describe void notify()
wakes up a single thread that is waiting on the object’s monitor
Method - Describe void notifyAll()
wakes up all threads that are waiting on the object’s monitor
Method - Describe String toString()
returns a string representation of the object
automatically called if you print an Object. Usually, this is overridden to provide human-readable output
Method - Describe void wait()
causes the current thread to wait until another thread invokes the notify() or the notifyAll() method for the object
Method - Describe void wait(long timeout)
causes the current thread to wait until either another thread invokes the notify() or the notifyAll() method for the object, or a specified amount of time has elapsed
Method - Describe void wait(long timeout, int nanos)
causes the current thread to wait until another thread invokes the notify() or the notifyAll() method for the object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed
What is an Error?
Some examples?
An Error represents something that went so wrong with your application that you shouldn’t attempt to recover from it
EX - ExceptionInInitializerError, OutOfMemoryError, StackOverflowError
Define hash code
a number that puts instances of a class into a finite number of categories
try/catch/finally block rules (5)
What are unchecked exceptions?
Examples?
an exception that is not required to be handled or declared
EX: RuntimeException;
Define annotations
special constructs that use the @ symbol. provide metadata about the source code to the compiler and JVM
Explain Test Driven Development (TDD)
Steps
Define Unit Testing
testing of individual software components in isolation from the rest of the system; writing unit tests which execute the code we want to inspect
JUnit Annotations
Java framework for unit testing
static Assert methods (5)
JUnit Assertions
verifies that the state of the application meets what is expected
What annotation would you use to prevent a test from running?
@Ignore (use sparingly!)
Testing Best Practices (7)
4 types of variable scopes in Java?