Ch 2 Flashcards

1
Q

<p>What is a pixel?</p>

A

<p>A unit of illumination on the screen.</p>

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

<p>What is a compile-time error?</p>

A

<p>An error that will affect the compilation and correct running of the file</p>

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

<p>How do you create text?</p>

A

<p>g.drawString (&quot;Hello World, 100, 200);</p>

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

<p>Run-time error</p>

A

<p>error that occurs during the execution of a program</p>

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

<p>Syntax</p>

A

<p>syntax of a computer language is the set of rules that defines the combinations of symbols that are considered to be a correctly structured document or fragment in that language</p>

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

<p>Semantics</p>

A

<p>semantics is the field concerned with the rigorous mathematical study of the meaning of programming languages
</p>

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

<p>True or False: Java is not case-sensitive.</p>

A

<p>False</p>

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

<p>What starts with uppercase letter?</p>

A

<p>Packages, Files, Classes</p>

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

<p>What starts with a lowercase letter?</p>

A

<p>methods, objects, variables</p>

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

<p>What does init stand for?</p>

A

<p>Initialization</p>

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

Soft returns vs. hard returns

A

soft=computer generated

hard=clicking the enter key

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

Which symbols must have matches?

A

() {} [] “” ‘’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q
Which is correct:
my Method
myMethod 
MyMethod
My Method
A

myMethod

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

What is the middle preprocessor directive?

A

import java.applet.*;

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

in this method:
g.drawString (“sup”, 1,1)
What is the dot?

A

a method selection operator

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

What two types of data does Java work with?

A

Primitive and Objects

17
Q

What is special about primitive data

A

It can’t be broken down any further

18
Q

How to set a background color

A

setBackground(Color.blue);

19
Q

How to set a size

A

setSize(1900, 1000);

20
Q

How to make arc

A

g.drawArc (100, 200, 300, 400, 270, 90);

21
Q

How to make filled in arc

A

g.fillArc (100, 200, 300, 400, 270, 90);

22
Q

In this command:
g.fillArc (100, 200, 300, 400, 270, 90);
What does 270 mean?

A

Start arc

23
Q

In the command:
g.fillArc (100, 200, 300, 400, 270, 90);
What does 90 mean?

A

End arc

24
Q

public is a ________

A

visibility modifier

25
Q

Name 3 visibility modifiers

A

public, private, protected

26
Q

Void is a ______

A

return type

Meaning: This method is reuturning nothing to calling method or class

27
Q

init and paint are what?

A

names of the method

idenitifier

28
Q

what goes in parentheses

A

arguments/parameters/coordinates/

all the same thing, but different words

29
Q

anything between curly braces is a

A

method block

30
Q

No semicolon if:

A

it has curly braces that belong to it

31
Q

What’s special about object data type?

A

It can be broken down

ex: a string can be broken down into characters

32
Q

What is PEMDAS

A

Parentheses, Exponents, Multiplication, division, addition, subtraction

33
Q

What is the difference between declare and initialize?

A

declare: create a memory location but not store data yet
Init: to store a value in a memory location

34
Q

name two primitive data types:

A

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

35
Q

65 ascii

A

A

36
Q

97 ascii

A

a