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?

23
Q

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

24
Q

public is a ________

A

visibility modifier

25
Name 3 visibility modifiers
public, private, protected
26
Void is a ______
return type | Meaning: This method is reuturning nothing to calling method or class
27
init and paint are what?
names of the method | idenitifier
28
what goes in parentheses
arguments/parameters/coordinates/ | all the same thing, but different words
29
anything between curly braces is a
method block
30
No semicolon if:
it has curly braces that belong to it
31
What's special about object data type?
It can be broken down | ex: a string can be broken down into characters
32
What is PEMDAS
Parentheses, Exponents, Multiplication, division, addition, subtraction
33
What is the difference between declare and initialize?
declare: create a memory location but not store data yet Init: to store a value in a memory location
34
name two primitive data types:
boolean, byte, char, double, float, int, long, short
35
#65 ascii
A
36
#97 ascii
a