1st Six Weeks Flashcards

You may prefer our related Brainscape-certified flashcards:
0
Q

When drawing a program, what are the variables called?

A

STATE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
1
Q

Name the primitive data types.

A

byte, int, long, short, char, boolean, float, and double

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

When drawing a program, what are the methods called?

A

BEHAVIOR

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do you write a main method?

A

public static void main(String[] args){

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does a byte contain?

A

A byte contains numbers between -128 to 127. Ex: 76

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does an int contain?

A

An int contains numbers between -2,147,483,648 to 2,147,483,647. Ex: 838,382

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does a short contain?

A

A short contains numbers between -32,768 to 32,767. Ex: -16,392

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does a long contain?

A

A long contains numbers between -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807. Ex: 477,838,383

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does a boolean contain?

A

A boolean contains the values of true and false.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does a double contain?

A

A double contains numbers with decimals. Ex: 10.8

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does a float contain?

A

A float contains numbers that are decimals. One must put a lower case f at the end to indicate that the variable is a float. Ex: 78.4f

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What does a char contain?

A

A char contains any character, surrounded by single quotes. Ex: ‘%’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What does int stand for?

A

Integer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What does char stand for?

A

Character

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How does one instantiate a reference type?

A

Ex: Puppy puppy1 = new Puppy();

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How does a void method look like?

A

Ex: public void copper{
System.out.println(“Hi”);
}

16
Q

How does one begin a driver program?

A

Ex: public class DogDriver{

17
Q

What is a mutator method?

A

A mutator method is used to set a value of a private field. It follows a naming scheme prefixing the word “set” to the start of the method name.

18
Q

Define an accessor method.

A

An accessor method is used to return the value of a private field. It follows a naming scheme prefixing the word “get” to the start of the method name.

19
Q

What is a toString method?

A

The toString method returns a string that “textually represents” an object.

20
Q

Write a value returning method.

A

public char symbol(){
return ‘^’;
}

21
Q

What is a modifier?

A

A modifier is a keyword placed in a class, method or variable declaration that changes how it operates.

22
Q

What is a variable?

A

Variables are “containers” for storing information.