Midterm Review Flashcards

1
Q

What does // represent?

A

A comment that can continue to the end of the line

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

What does /* asdfghjkl; */ represent?

A

A comment that can last multiple lines between the slashes

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

What does /** asdfghjkl; */ represent?

A

A javadoc comment

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

What is a syntax error?

A

A problem in the code makes a program unable to run

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

What is a logical error?

A

A program runs, but does not function properly due to a logic error

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

What is a run time error?

A

Something input to the code causes it to crash

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

What happens when a java program is run?

A

It is converted to byte code then to machine language

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

What happens when you type in a URL?

A

DNS converts it to an IP address

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

What can be used in an identifyer?

A

Letters, underscores, digits, $

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

What should class names always be in?

A

Title case

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

What’s the difference between high level and machine level code?

A

Machine is more abstract, and high level uses human language

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

What is analog like?

A

Continuous and exact

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

What is digital like?

A

Finite and not exact, but cheaper

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

What test simulates a human conversation?

A

Turring test

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

Where does java.charAt find letters?

A

Each letter is numbered, 0 is the first letter

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

What is assignment conversion?

A

Taking an int value and reassigning it as a double

17
Q

What is casting?

A

Specifying the output for something

18
Q

What is arithmetic promotion?

A

Doing math with 2 ints and storing it as a double

19
Q

What does an enumerated datatype do?

A

Store data from a small fixed set

20
Q

What class allows a primitive data to be used as an object?

A

Wrapper class

21
Q

How would you generate a random integer between 3 and 30 in Java?

A

math.nextInt(28) + 3

22
Q

What would num++ be?

A

num=num+1

23
Q

What would num+=10 be?

A

num=num+10

24
Q

What happens when you divide 2 interger values and store it in a double?

A

They will return an interger with no decimal, stored in a double. If you want said decimal, cast

25
Q

How do you find the last character of a string?

A

x.charAt(x.length()-1);

26
Q

How do you prep for the square root of a negative number in java?

A

Math.sqrt(Math.abs(x));

27
Q

What does % do?

A

Return the remainder of division as an int