Object Oriented Programming - Midterm 1 Terms

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/14

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

15 Terms

1
New cards

Object

a member of a Java class, with its own identity, behaviour, and state

2
New cards

Enum:

A datatype when an objects Structure or state can only have one of a small set of values

3
New cards

Packages

-A namespace that organizes a set of related classes and interfaces

-“different folders on your computer”

4
New cards

Access modifiers of a class

Public, default private

5
New cards

default Class Access modifier:

accessible only within the same package

6
New cards

private Class Access modifier:

modifiers only apply to nested classes

7
New cards

Access modifiers for class members:

Public default private protected

8
New cards

public class member access modifier

accessible from everywhere in the program

9
New cards

default class member access modifier:

accessible only within the same package

10
New cards

private class member access modifier

accessible only within the class in which they are declared

11
New cards

protected class member access modifier:

accessible within the same package or subclasses in different packages

12
New cards

encapsulation

-Wrapping the variables and code acting on the methods together as a single unit

-variables of a class will be hidden from other classes and can be accessed only though the methods of their current class

13
New cards

To achieve encapsulation in Java:

-declare the variables of a class as private

-provide public setter and getter methods to modify and view the variables values

14
New cards

This keyword

-refers to the current object in a method

-eliminates the confusion between class attributes and parameters with the same name constructors

15
New cards

Class

-when defined in java, it is usually a new data type
-Used to make multiple objects, defined by its properties