Java Basics Flashcards

1
Q

What does XXX mean in the following:

class XXX

A

Class or program name

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

What does each of these mean:

\
“\n”

n
Double slash
\”

A

\ = Next character is printable
“\n” = New line
“ = String Delimiter
n = Printable n
\ = Printable slash
\” = Printable

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

Any character used as an identifier must be?

A

Letter, digit, or underscore (_)

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

What can the first character in an identifier not be?

A

A digit

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

What is PascalCase and camalCase?

A

PascalCase = All the starting letters in a word are capitalized

camalCase = First letter of the first word is not capitalized but rest are

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

To which are PascalCase and camalCase conventionally assigned as?

A

PascalCase = Classes

camalCase = Variables and methods

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

For numeric data types, is it possible to convert from smaller to larger types but not reverse.

TRUE or FALSE

A

TRUE

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

What is a cast?

A

Forcing Java to make a data type conversion

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

What are constants and what are they conventionally assigned as?

A

Variables which’s values cannot be changed.

All UPPERCASE

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

What is a computer?

A

A machine that stores data (numbers, words, pictures), interacts with devices (monitors, speakers, mouse), and executes commands

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

What is programming?

A

Giving the computer a set of instructions to follow or execute

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

What is the processor in a computer responsible for?

A

Executing a variety of instructions

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

What did early model computers use to carry out translations?

A

Assembler

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

What does the assembler do?

A

Takes a sequence of characters such as iload and translates it into command code 21

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

What does a compiler do?

A

Translates high-level descriptions into machine instructions

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

In what year and who developed the coding language which they named “Green”?

A

1991 / James Gosling and Patrick Naughton at Sun Microsystems

17
Q

What could the HotJava browser download and run?

18
Q

In 1996, which two major companies supported Java?

A

Netscape and Microsoft

19
Q

What is an object?

A

An entity you can manipulate by calling methods

20
Q

What does every object belong to?

21
Q

What is the process of creating an object called?

A

Construction

22
Q

What two elements does a class contain?

A

Variables and methods

23
Q

What is a instance field?

A

A variable defined in a class for which every object has its own value

24
Q

What is a variable?

A

A symbol in a class that can hold values

25
What does an instance field declaration consist of?
An access specifier (public or private) The type of variable (int or string) The name of the variable
26
What are the three things each variable has?
A name A value A type
27
What is the name you choose for a variable known as?
Identifier
28
What 3 things can an identifier start with?
A letter An underscore A dollar sign
29
A data type has ___ basic types and can be defined in ___ categories.
8 and 3
30
What are the 3 main categories for data types?
Numeric Boolean Characters
31
What are the 2 types of numeric data types?
An integer with no fraction and a floating point
32
What are the 4 types of integers?
Byte Short Long Int
33
What does a variable of type char hold?
A single character
34
What do each of these mean: \b \t \r
\b = Backspace \t = Tab \r= Carriage Return
35
Any expression in a parenthesis is evaluated first. TRUE or FALSE
TRUE
36
Parenthesis can be nested, if so: the OUTERMOST expression is evaluated first. TRUE or FALSE
FALSE (it is the innermost)
37
What are the 2 data types for floating points?
Double & Float