CS 1301 EXAM 1 STUDY GUIDE
Steps to compile and run a Java Program from the command prompt - Answers - 1.
javac NameofyourJavaFile.java
2. java NameofyourJavaFile.class
Main Memory - Answers - holds the current program and much of the data that the
program is manipulating; volatile
Auxiliary Memory (Secondary Memory) - Answers - Exists even when the computer's
power is off; not volatile; Ex: hard disk, DVDs
ASCII Chart - Answers - Computer chart that is used to represent the characters on
your keyboard
Machine Code - Answers - The language that the computer can directly understand
Opcode - Answers - is the portion of a machine language instruction that specifies the
operation to be performed.
Operands - Answers - Any object that can be manipulated
Ex: 1 and 2 in 1+2
Instructions - Answers - a statement; it ends with a semicolon
Assembly Language - Answers - Symbolic form of machine language that is easier for
people to read
Java Byte Code - Answers - The machine language for an interpreter called the Java
Virtual Machine (JVM)-- Happens when you compile a Java file in Eclipse
Syntax Errors - Answers - Caused by a grammatical mistake in the program
Runtime Errors - Answers - An error that is detected when your program is run
Logic Errors - Answers - Conceptual mistakes in the program or algorithm
Java Class - Answers - created after compiling the java file (byte code)
Java File - Answers - file containing the source code
Methods to use Println() API - Answers - Println() to print out a line (can also
concatenate a variable); Print()--- prints out but does not move to the next line; can also
include escape characters for formatting
, The Eight Java Primitive Data Types - Answers - Double, Int, Byte, Float, Boolean,
Char, Short, Long
Double - Answers - 8 bytes; Floating point
Int - Answers - 4 bytes; Integer
Byte - Answers - 1 byte; Integer
Float - Answers - 4 bytes; Floating-point
Boolean - Answers - 1 bit; true or false
Char - Answers - 2 bytes; Singular Character
Short - Answers - 2 bytes; Integer
Long - Answers - 8 bytes; Integer
Sequence of the Sizes (Java Data Types) - Answers - byte -> short-> int-> long-> float->
double
Java Identifiers - Answers - A word used to name something in the program (e.g. a
variable, a method, a class, etc)
Reserved Words - Answers - Certain expressions that cannot be used as identifiers (Ex:
data types, if, try, while, switch, etc)
CamelCase - Answers - the naming convention used for variables where the first letter
isnt capitalized but the letter that starts the second word is (Ex:notFalse)
How to convert binary number to decimal (Lecture 2; 34-35) - Answers - Ex: 11110
1. Label the bases under the binary number
Ex: 1 1 1 1 0
2^4 2^3 2^2 2^1 2^0
2. Where there are ones in the binary number, record the base number
Ex: 16 8 4 2
3. Add the recorded bases up
Ex: 30
Importing the Scanner Class - Answers - import java.util.Scanner;
Java Naming Conventions - Answers - Class names always start with capital letters;
Primitive types begin with a lowercase letter;
Object, method and variable names use camelcase
Steps to compile and run a Java Program from the command prompt - Answers - 1.
javac NameofyourJavaFile.java
2. java NameofyourJavaFile.class
Main Memory - Answers - holds the current program and much of the data that the
program is manipulating; volatile
Auxiliary Memory (Secondary Memory) - Answers - Exists even when the computer's
power is off; not volatile; Ex: hard disk, DVDs
ASCII Chart - Answers - Computer chart that is used to represent the characters on
your keyboard
Machine Code - Answers - The language that the computer can directly understand
Opcode - Answers - is the portion of a machine language instruction that specifies the
operation to be performed.
Operands - Answers - Any object that can be manipulated
Ex: 1 and 2 in 1+2
Instructions - Answers - a statement; it ends with a semicolon
Assembly Language - Answers - Symbolic form of machine language that is easier for
people to read
Java Byte Code - Answers - The machine language for an interpreter called the Java
Virtual Machine (JVM)-- Happens when you compile a Java file in Eclipse
Syntax Errors - Answers - Caused by a grammatical mistake in the program
Runtime Errors - Answers - An error that is detected when your program is run
Logic Errors - Answers - Conceptual mistakes in the program or algorithm
Java Class - Answers - created after compiling the java file (byte code)
Java File - Answers - file containing the source code
Methods to use Println() API - Answers - Println() to print out a line (can also
concatenate a variable); Print()--- prints out but does not move to the next line; can also
include escape characters for formatting
, The Eight Java Primitive Data Types - Answers - Double, Int, Byte, Float, Boolean,
Char, Short, Long
Double - Answers - 8 bytes; Floating point
Int - Answers - 4 bytes; Integer
Byte - Answers - 1 byte; Integer
Float - Answers - 4 bytes; Floating-point
Boolean - Answers - 1 bit; true or false
Char - Answers - 2 bytes; Singular Character
Short - Answers - 2 bytes; Integer
Long - Answers - 8 bytes; Integer
Sequence of the Sizes (Java Data Types) - Answers - byte -> short-> int-> long-> float->
double
Java Identifiers - Answers - A word used to name something in the program (e.g. a
variable, a method, a class, etc)
Reserved Words - Answers - Certain expressions that cannot be used as identifiers (Ex:
data types, if, try, while, switch, etc)
CamelCase - Answers - the naming convention used for variables where the first letter
isnt capitalized but the letter that starts the second word is (Ex:notFalse)
How to convert binary number to decimal (Lecture 2; 34-35) - Answers - Ex: 11110
1. Label the bases under the binary number
Ex: 1 1 1 1 0
2^4 2^3 2^2 2^1 2^0
2. Where there are ones in the binary number, record the base number
Ex: 16 8 4 2
3. Add the recorded bases up
Ex: 30
Importing the Scanner Class - Answers - import java.util.Scanner;
Java Naming Conventions - Answers - Class names always start with capital letters;
Primitive types begin with a lowercase letter;
Object, method and variable names use camelcase