Class Notes Flashcards
How many values does a bit represent
Two values
How many values does 2 bits represent
4 values
How many values does 3 bits represent
8 values
What numbers define the binary number system
0,1
How do you determine largest value if you have a base number
The largest value is 1 less then the base value
What is the largest number for base 10
9
What is the largest number for base 8
7
What number of values do 4 bits have
16 values
What is 1 byte equal to?
8 bits
What is 1 byte considered
The smallest addressable memory unit
How many values are in one byte
256 values
What is 1MB in base 10
10^6
What is 1GB in base 10
10^9
What is 1TB in base 10
10^12
Can values be both positive or negative?
Yes
Values can either be …
Characters or numbers
What are numbers with no decimal called
Intergers
What are numbers with a decimal called
Floating point numbers
What are the 4 interger types
byte
short
int
long
What is the default type for intergers
int
How many bytes does a byte represent
1 byte
How many bytes does a short represent
2 bytes
How many bytes does an int represent
4 bytes
How many bytes does a long represent
8 bytes
What are the two types of floating point numbers/types
Float and a double
How many bytes does a float represent
4 bytes
How many bytes does a double represent
8 bytes
If the first bit is 0 in an interger, is it positive or negative
Positive
If the first bit is 1 in an interger is it positive or negative
Negative
In an interger what does the first value represent
Sign bit
In an interger what does the second value represent
Exponent
In an interger what does the remaining bits represent (not the sign or exponent)
The mantissa
What is the default type for floating point numbers
Double
What are fractional numbers
Numbers with decimals
What does && mean
And
What does ll mean
Or
What would 12 be interpreted as
An int
What would 12.0 be interpreted as
A double
What are the 8 primitive built in types for Java
Byte, short, int, long
Float, double
Char
Boolean
What is a char used for
To store 1 character.
How much space does a char occupy
1 byte
What is Boolean used to represent
True or false
What are types in italics called
Interfaces
What type of class would be used to represent someone’s name
String class
What does ‘ ‘ specify
A character
What does ‘A’ specify
The a character
What is \ called
The escape character
What does \ ‘ show up as
’
What does \ “ show up as
”
What does \n do
New line
What does \t do
Tab
What do capital letters indicate when discussing types
A non primitive type
What are types
Values such as intergers
What happens if you introduce operations to a type
It then becomes a data type
What is a data type
A type + an operation
Describe programming in the 70s
Programming languages were called machine language., then assembly language. It was required that you use an assembler to compile and convert to binary to be more efficient.
What were low level programming languages
the early programming languages of the 70s
What are some examples of high level programming languages
Java, C, C++, Pascal etc
What is a high level programming language
Resembles the english language so it is easy for the programmer to understand
What was FORTRAN
an old school business oriented language
What was the disadvantage to the early programming languages
The disadvantage to the old programming languages was that they were very procedural and required knowing all of the procedures and how to use them
What are Java and C++ considered
project oriented languages
What is the difference between C and C++
C++ is the same as C but object oriented features included
What is the disadvantage to C++
Very complex after you get past introductory concepts
What was java created for
Created for unifying the programming behind microwaves, toasters etc
Was java created for a specific OS
No, it was created for a virtual machine
What would the purpose of Java’s virtual machine be
Would translate to other OS and served to unify the whole operation
What is the difference between print and println
Println will print something and place it on the same line.
How do you comment out lines of code
// infront of the line or after curly bracket to comment out all of the code.
How do you choose variable names
1) name of variable must begin with a letter (can be of any length)
2) may only contain letters, digits, and underscore character
What is it called when you assign a number to a variable
initializing