Writing Classes

studied byStudied by 120 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 1 person
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 8 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 2495 people
Updated ... ago
4.7 Stars(18)
note Note
studied byStudied by 9 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 1 person
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 74 people
Updated ... ago
4.0 Stars(1)
note Note
studied byStudied by 7 people
Updated ... ago
5.0 Stars(2)
note Note
studied byStudied by 6 people
Updated ... ago
5.0 Stars(1)

Explore top flashcards

flashcards Flashcard89 terms
studied byStudied by 9 people
Updated ... ago
5.0 Stars(2)
flashcards Flashcard34 terms
studied byStudied by 334 people
Updated ... ago
5.0 Stars(2)
flashcards Flashcard94 terms
studied byStudied by 31 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard30 terms
studied byStudied by 24 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard188 terms
studied byStudied by 9 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard45 terms
studied byStudied by 27 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard174 terms
studied byStudied by 24 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard33 terms
studied byStudied by 1780 people
Updated ... ago
4.6 Stars(29)