oop Flashcards
public classes cannot be altered
false, they can be altered outside of it’s class.
private: you can only alter it in it’s class, never outside
when you don’t intialize the class as public or private, it well assume by default that it is:
public
the default value that java will give a public numeric variable:
0
the default value that java will give a public char/string:
null
the default value that java will give a public boolean variable:
false
T/F: we can access attributes inside an object by the name of object and dot (period) (access member)
true
To use an object from another class it must be in the same ________
folder
public void setTime(int h , int m, int s)
we call this:
setter (Mutator)
public int getSec(){
return sec;
}
we call this:
getter (Accessors)
a constructor with empty paranthesis is called
parametrized constructor
when i don’t have any constructor in my class and java makes/gives me a constructor
default constuctor
T/F: java conducts a defaults constuctor if my code doesn’t have a constructor.
true.
UML stands for
unified model language
the UML is composed in three parts:
1) the name of the class,
2) the names of the variables, their type and whether they are public (+) or private (-),
3) and lastly the methods, their names next to it’s type
T/F: A constructor is always public.
true
T/F: the name of the constructor can be different from the name of the class.
false, it’s always the same as class
T/F: A constructor is not void, but does return a value.
false, it’s not void and does not return a value.
T/F: there can be more than one constructor in an overload.
true
T/F: you must call out a constructor.
false, a constructor does not need to be called to performed.
what does this( ) do?
calling to another constructor within the same class
which kind of copy is this?
Clock c4 = new Clock ( c2 );
deep copy (composetion)
which kind of copy is this?
Clock c5 = c2;
shallow copy (Agregation)
a parameterized constructor
a constructor with different set values for the objects
default constructor
no values set for the objects within the constructor