Flashcards in Midterm Review Deck (27)
Loading flashcards...
1
What does // represent?
A comment that can continue to the end of the line
2
What does /* asdfghjkl; */ represent?
A comment that can last multiple lines between the slashes
3
What does /** asdfghjkl; */ represent?
A javadoc comment
4
What is a syntax error?
A problem in the code makes a program unable to run
5
What is a logical error?
A program runs, but does not function properly due to a logic error
6
What is a run time error?
Something input to the code causes it to crash
7
What happens when a java program is run?
It is converted to byte code then to machine language
8
What happens when you type in a URL?
DNS converts it to an IP address
9
What can be used in an identifyer?
Letters, underscores, digits, $
10
What should class names always be in?
Title case
11
What's the difference between high level and machine level code?
Machine is more abstract, and high level uses human language
12
What is analog like?
Continuous and exact
13
What is digital like?
Finite and not exact, but cheaper
14
What test simulates a human conversation?
Turring test
15
Where does java.charAt find letters?
Each letter is numbered, 0 is the first letter
16
What is assignment conversion?
Taking an int value and reassigning it as a double
17
What is casting?
Specifying the output for something
18
What is arithmetic promotion?
Doing math with 2 ints and storing it as a double
19
What does an enumerated datatype do?
Store data from a small fixed set
20
What class allows a primitive data to be used as an object?
Wrapper class
21
How would you generate a random integer between 3 and 30 in Java?
math.nextInt(28) + 3
22
What would num++ be?
num=num+1
23
What would num+=10 be?
num=num+10
24
What happens when you divide 2 interger values and store it in a double?
They will return an interger with no decimal, stored in a double. If you want said decimal, cast
25
How do you find the last character of a string?
x.charAt(x.length()-1);
26
How do you prep for the square root of a negative number in java?
Math.sqrt(Math.abs(x));
27