java review Flashcards
what are some basic data types
int, char , string, long, short
what are the three access control modifiers
public, private, protected
what is the modifier static do?
not associoted with a particurlar object
what is an object
is an instance of a class, which serves as the type of the object and as the blueprint
- defining the data which the object store for methods
what is a class
classes are refrence types in java
what is an interface?
its basically just an outline of what the class will look like with the methods
how is interface written
public interface sellable{ //tells you what each method does
//returns a description of the object public String description();
}
how do you use an interface in a class( code wise)
public class photograph implements Sellable{
}
what is encapsulation
hides the internal details of implementations, gives the programmer freedom to implement the details of a compnenet
what is inheritance
a base class is exteded to a superclass. promotes reuse of code. can have overloading and overriding
what is polymorphism
a polymorphism refrence can refer to a diffrent types of objects at diffrent points in time
what are 3 of the object oriented design princples
- encapsulation
- inheritance
- polymorphism
what is the diffrence between overriding and overloading
Overriding- rewrite it in a parent class same signature, just does something slightly different Overloading- same method name but with different signature in subclass
types of recursion
linear
binary
mutple
what are the designs of recursion method
base case: output fixed values without using recursion
recursive case: makes recursive calls based on a recurrence relationship so that they make progress towards base case