java review Flashcards

1
Q

what are some basic data types

A

int, char , string, long, short

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what are the three access control modifiers

A

public, private, protected

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what is the modifier static do?

A

not associoted with a particurlar object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

what is an object

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what is a class

A

classes are refrence types in java

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what is an interface?

A

its basically just an outline of what the class will look like with the methods

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

how is interface written

A
public interface sellable{
//tells you what each method does
//returns a description of the object
    public String description();

}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

how do you use an interface in a class( code wise)

A

public class photograph implements Sellable{

}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

what is encapsulation

A

hides the internal details of implementations, gives the programmer freedom to implement the details of a compnenet

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

what is inheritance

A

a base class is exteded to a superclass. promotes reuse of code. can have overloading and overriding

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

what is polymorphism

A

a polymorphism refrence can refer to a diffrent types of objects at diffrent points in time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

what are 3 of the object oriented design princples

A
  • encapsulation
  • inheritance
  • polymorphism
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

what is the diffrence between overriding and overloading

A
Overriding- rewrite it in a parent class same signature, just does something slightly different 
Overloading- same method name but with different signature  in subclass
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

types of recursion

A

linear
binary
mutple

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

what are the designs of recursion method

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

what is the diffrence between recursion and iteration

A
  • recursion describes repetition succinctly which simpliefies algorithm analysis . we often avoid complex case analysses and nested loops
  • recursion comes at a modest cost
  • some recursions can be translated into iterations