semis Flashcards

(39 cards)

1
Q

a way to classify programming languages based on their features

A

programming paradigm

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

two main paradigm

A
  • Procedural programming
  • Object Oriented Programming
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

OOP

A

Object Oriented Programming

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

a programming paradigm based on the concept of “objects”

A

Object Orented Programming

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

OBJECTS can contain:

A
  • data(attributes/ properties)
  • methods(functions or behaviors)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

real life analogy, identify which is the attributes and methods
1. color, brand, speed
2. drive(), stop(), honk()

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

4 pillars of OOP

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

bundling data and methods into a single unit(class)

A

encapsulation

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

t/f: encapsulation protects data from unauthorized access

A

true

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

private fields with public getters/setter

A

encapsulation

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

hiding complex implementation, showing only essential features

A

abstraction

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

you use a tv remote without knowing how it works

A

abstraction

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q
  • one interface, many forms
  • a method behaves differently depending on the object
A

inheritance

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

draw() method behaves differently in circle, square

A

inheritance

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

Allows different classes to be treated as instances of the same class through method overriding.

A

polymorphism

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

why used OOP

A
  • code reusability
  • easier to debug and maintain
  • better organization
  • closer to real-world modeling
17
Q

a paradigm used to develop complex software systems by organizing problems into objects

A

object-oriented programming

18
Q

combining data(attributes) and methods(functions) into one unit(class)

A

encapsulation

19
Q

promotes code reuse and logical hierarchy

20
Q

t/f: encapsulation is a protective layer that ensures data integrity and restricts unauthorized access

21
Q

type of paradigms: Encapsulation can be performed through modularization, which groups data and functions into
procedures or functions. Information hiding can be implemented by careful function design.

A

procedural programming

22
Q

types of paradigm: prioritizes immutability, but
developers can still employ encapsulation
by constructing higher-order functions that
bundle data and behavior

A

Functional
programming

23
Q

how encapsulation works

A
  • declare data members as private
  • provide public methods (getter and setters)
  • implements data validation
24
Q

benefits of encapsulation

A
  • data protection
  • security
  • code reusabality
  • maintainability
25
a core principles of encapsulation, it involves limiting access to an objects internal state to preserve
data hidng
26
by controlling access to data, ensuring consistency and valid
data integrityi
27
isolating data within a class makes the code easier to understand, modify, and test
maintainability
28
protecting sensitive data
security
29
access modifiers in java
- default - protected - public - private
30
accessible within the same package
default
31
accessible only within the class
private
32
accessible from any other class
public
33
accessible within the same package and subclasess
protected
34
only accessible within its own class. classes and interfaces can not be declared private
private
35
getter/setters : returns the value of private variable
getter
36
getter/setters : updates the value with validation if needed
setters
37
t/f: getters and setters enhance code security and maintain proper data handling
true
38
blueprint/ template
classes
39