Writing Classes

studied byStudied by 122 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 12 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 236 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 11 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 12 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 20 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 15 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 8 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 36 people
Updated ... ago
5.0 Stars(1)

Explore top flashcards

flashcards Flashcard57 terms
studied byStudied by 69 people
Updated ... ago
4.8 Stars(4)
flashcards Flashcard279 terms
studied byStudied by 2 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard40 terms
studied byStudied by 10 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard37 terms
studied byStudied by 173 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard40 terms
studied byStudied by 15 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard113 terms
studied byStudied by 6 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard61 terms
studied byStudied by 131 people
Updated ... ago
5.0 Stars(3)
flashcards Flashcard77 terms
studied byStudied by 19 people
Updated ... ago
4.0 Stars(1)