Writing Classes

studied byStudied by 143 people
4.5(2)
Get a hint
Hint

Class

1 / 26

27 Terms

1

Class

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

New cards
2

Indentations

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

New cards
3

Variable declarations

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

New cards
4

.java extension

lets the compiler recognize the file as containing java code.

New cards
5

.java file

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

New cards
6

Method

A group of code that performs a specific task.

New cards
7

Driver class

A class that is created to control a larger program

New cards
8

Object class

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

New cards
9

Java

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

New cards
10

Java language

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

New cards
11

Header

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

New cards
12

Constructor

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

New cards
13

Parameters

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

New cards
14

instance variables, or fields

Three attributes in order for the code to function correctly.

New cards
15

Visibility

is if the method is public or private.

New cards
16

Return type

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

New cards
17

Method name

is the name of the method.

New cards
18

Overloading

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

New cards
19

Precondition

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

New cards
20

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.

New cards
21

Composition

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

New cards
22

Driver and object classes

must be in the same folder on the computer.

New cards
23

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.

New cards
24

Aggregate class

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

New cards
25

this

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

New cards
26

Static variable

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

New cards
27

Non-constructor

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

New cards

Explore top notes

note Note
studied byStudied by 25 people
... ago
5.0(1)
note Note
studied byStudied by 47 people
... ago
5.0(1)
note Note
studied byStudied by 5 people
... ago
5.0(1)
note Note
studied byStudied by 16 people
... ago
5.0(1)
note Note
studied byStudied by 16 people
... ago
5.0(2)
note Note
studied byStudied by 7 people
... ago
5.0(1)
note Note
studied byStudied by 1 person
... ago
4.0(1)
note Note
studied byStudied by 170 people
... ago
5.0(1)

Explore top flashcards

flashcards Flashcard (79)
studied byStudied by 4 people
... ago
5.0(2)
flashcards Flashcard (30)
studied byStudied by 5 people
... ago
5.0(1)
flashcards Flashcard (676)
studied byStudied by 70 people
... ago
5.0(1)
flashcards Flashcard (42)
studied byStudied by 27 people
... ago
5.0(1)
flashcards Flashcard (93)
studied byStudied by 23 people
... ago
5.0(1)
flashcards Flashcard (194)
studied byStudied by 28 people
... ago
5.0(1)
flashcards Flashcard (51)
studied byStudied by 10 people
... ago
5.0(2)
flashcards Flashcard (26)
studied byStudied by 282 people
... ago
4.7(7)
robot