Java: OOP (Part 1)

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

1/40

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.

41 Terms

1
New cards

Java

____ is an object-oriented programming language

2
New cards

Object-oriented

______ programming organizes a program around its data and a set of well-defined interfaces to that data

3
New cards

class, instantiated

In Java, the unit of programming is the ___ from which objects are _____

4
New cards

methods, fields

Java classes contain ____ (which implement operations) and ____ (which implement attributes)

5
New cards

class

A ____ is a blueprint from which individual objects are created

6
New cards

class

A class is declared by use of the _____ keyword

7
New cards

Local variables

______ are defined inside methods, constructors or blocks

8
New cards

Instance variables

_____ are variables within a class but outside any method

9
New cards

Class variables, static

______ are variables declared within a class, outside any method, with the ___ keyword

10
New cards

Constructor

_____ in Java is a special type of method that is used to initialize the object

11
New cards

constructor

Every class has a ______

12
New cards

more than one

A class can have _____ constructor

13
New cards

class

The main rule of constructors is that they should have the same name as the ____.

14
New cards

new

In Java, the ___ keyword is used to create new objects

15
New cards

memory, address

The new operator dynamically allocates ____ for an object and returns a reference to it. This reference is the _____ in memory of the object allocated by new keyword

16
New cards

Declaration
Instantiation
Initialization

Three steps to create an object

17
New cards

Declaration

variable declaration (name with an object type)

18
New cards

Instantiation

using the new keyword to create the object

19
New cards

Initialization

new keyword is followed by a call to a constructor

20
New cards

objects

Instance variables are accessed via created _____

21
New cards

First create an object
Call the instance variable

To access an instance variable:

22
New cards

objects

Instance methods are accessed via created _____

23
New cards

First create an object
Call the instance method

To access an instance method:

24
New cards

Java method

A ______ is a collection of statements that are grouped together to perform a specific operation

25
New cards

type modifier

defines the access type of the method and it is optional to use

26
New cards

return type

method may return a value

27
New cards

method name

name of the method

28
New cards

argument list

list of parameters, it is the type, order, and number of parameters of a method. These are optional, method may contain zero parameters

29
New cards

method body

defines what the method does with statements

30
New cards

static

A method that has static keyword is known as ___ method

31
New cards

instance

The method of the class is known as an _____ method

32
New cards

instance method

It is a non-static method defined in the class

33
New cards

object

Before calling or invoking the instance method, it is necessary to create an _______ of its class

34
New cards

accessor, getters

The method that reads the instance variable is known as the _____ method. is also known as _____

35
New cards

get

The accessor method is prefixed with the word ____

36
New cards

private

Accessor method returns and used to get the value of the _____ field

37
New cards

mutator, setters, modifiers

The method that read the instance variable and also modify the values is known as the _____ method. It is also known as _____ or ______

38
New cards

void

The ____ keyword allows us to create methods which do not return a value

39
New cards

public
default
protected
private

Access modifier by hierarchy:

40
New cards

Local variable
Instance variable
Class variable

Types of variables

41
New cards

Static method
Instance method
Accessor method
Mutator method

Types of methods