Writing Classes

4.5(2)
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/26

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

27 Terms

1
New cards

Class

When a group of statements, such as control structures, are all put together to be referred to this.

2
New cards

Indentations

It needs to be correctly indented for the code to be considered a part of the class.

3
New cards

Variable declarations

are found at the top of the code right after the header.

4
New cards

.java extension

lets the compiler recognize the file as containing java code.

5
New cards

.java file

is called the source code for a program because it defines the program’s actions and functions.

6
New cards

Method

A group of code that performs a specific task.

7
New cards

Driver class

A class that is created to control a larger program

8
New cards

Object class

This class houses the “guts” of the methods that the driver class calls.

9
New cards

Java

is a descendent of the object class in the Java language.

10
New cards

Java language

Every class in Java is a descendent of the object class in the

11
New cards

Header

It’s used to define the function of the method.

12
New cards

Constructor

They set an object's initial values for instance variables.

13
New cards

Parameters

(these are optional) They are data that the method needs to function properly.

14
New cards

instance variables, or fields

Three attributes in order for the code to function correctly.

15
New cards

Visibility

is if the method is public or private.

16
New cards

Return type

specifies the type of data that will be returned from the methods after its commands are executed.

17
New cards

Method name

is the name of the method.

18
New cards

Overloading

writing multiple methods that perform the same task, but require different information, or parameters to to something.

19
New cards

Precondition

A comment that is intended to inform the user more about the condition of the method and guarantees it to be true.

20
New cards

Postcondition

A condition that must always be true just after the execution of a section of code, or after an operation in a formal specification.

21
New cards

Composition

In order for the classes to come together and have the program function properly, they need to work together properly.

22
New cards

Driver and object classes

must be in the same folder on the computer.

23
New cards

Programmer

has to take on the responsibility of deciding which objects to instantiate and to which types and when to use them, and how they are used based on the needs of the class.

24
New cards

Aggregate class

Made up of other data, and instances of other classes.

25
New cards

this

is a keyword used to reference the current calling object and may be used as an object variable.

26
New cards

Static variable

is an attribute that is shared among all instances of a class.

27
New cards

Non-constructor

method that is designed to access or modify a static variable is a static method.