Revision exam tp1 Flashcards

1
Q

byte

A

1 octet -128 à +127

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

short

A

2 octets -32768 à +32767

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

int

A

4 octets -2147483648 à +2147483647

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

long

A

8 octets -9233372036854775808 à 9233372036854775807

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

Flottants ou décimaux

A

4 octets

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

char

A

2 octets

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

double

A

8 octets

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

boolean

A

1 octet true et false

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

byte temperature = 125;
temperature++;
temperature++;
temperature++;

A

// - 128

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

Types: Sans besoins particuliers java nous encourage à utiliser…

A

int et double comme types de base

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

short total = 25000;
int note1 = 0
total = note1;

A

Invalide: Les variables ne sont pas du meme type, (4 octet ds 2 octets)

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

short total = 25000;
int note1 = 0
total = (short) note1;

A

Valide grace au casting : transformer le resultat de type int en short

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

short total = 25000;
int note1 = 0
total = total + 1

A

Invalide : le 1, par defaut, cest un entier de type int

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

float salaire = 45000.50f;
int note3 = 5
salaire = (float) note3 / 2;

A

2.5

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

float salaire = 45000.50f;
int note3 = 5
salaire = note3 / 2f;

15
Q

int x = 10
var result = x / 3;

A

// resultat : 3

16
Q

doube moyenne = 10.0;
var result = moyenne / 3

A

resultat : 3.33333