Lecture 1 Flashcards
Binary code?
0101010101000011
Machine code?
9E 67 8F A4 4F BA
Assembly?
mov eax, 4
mov ebx, 1
add eax, ebx
call printf
High-level programming languages?
C, C++, C#, Java, Python, PHP, Go
What is interpreting?
Translating one line of higher language code into machine code and executing it
What is compiling?
Translating an entire program written in a higher level language into machine cod, so that it can be executed
Which high-level programming languages are compiled for a certain platform?
C, C++, Haskell, Go
What high-level programming languages are compiled into an intermediate format?
Java, C#, Scala
Which high-level programming languages are interpreted?
Python, Ruby, PHP
How is the intermediate format of Java called?
bytecode
How are bytecode files executed?
by a virtual machine, the JVM
What are the three different types of high-level programming languages?
- Compiled for a specific platform
- Compiled into an intermediate format, so that they can be executed on any platform
- Interpreted
What data types, do the java primitive data types cover?
Booleans,
integers,
floating-point numbers,
characters
What are the two types of data in Java
Primitive and reference
What binary number representation does java use for integers?
Two’s complement
How are 32-bit real numbers stored?
How many bits are used for which values?
Floating-point. 1 bit for sign, 8 for exponent, 23 for mantissa sign X mantissa x 2^exponent
How many primitive data types does java have?
8
What primitive data types does java have?
boolean, byte, short, int, long, float, double, char
How many bits is a boolean and what can this represent?
1, true/false
how many bits is a byte and what can it represent
8, integers
how many bits is a short and what can it represent
16, integers
how many bits is an int and what can it represent?
32, integers
how many bits is a long and what can it represent?
64, integers
how many bits is a float and what can it represent?
32, real numbers