Basic Java Programming Flashcards

1
Q

Name the types of data types in Java.

A
  1. Primitive data types used to store simple values
  2. Refernce data types used to store the address of Objects
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the fomular for calculating range of values for number data types?

A

-2^n-1 to 2^n-1 -1

where n is the number of bits for each data type

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

Name all number data types and the bits for each type.

A

byte => 8 bits
short => 16 bits
int => 32bits
long => 64bits

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

Name all the floating point datatypes and the number of bits for each

A

float => 32 bits
double => 64 bits

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

How many bits are booleans, and char’s?

A

boolean => 1 bit
char => 16 bits

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

Name a few reference datypes?

A

Classes
Strings
Arrays
Interfaces

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

What are the type of variables in Java?

A
  1. Local variables: variables that exist only within a block or method
  2. Instance variables: Variables that belong to an object or class and are not static
  3. Static variables: Variables shared accross all objects
  4. Parameters
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the different types of operators in Java?

A
  1. Arithmetic
  2. Logical
  3. Relational
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

name 3 types of loops in Java

A

for, while, and do while

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