Buscar

What is the difference between double and float variables in Java? Float takes 4 bytes in memory while Double takes 8 bytes in memory. Float is do...

What is the difference between double and float variables in Java?

Float takes 4 bytes in memory while Double takes 8 bytes in memory.
Float is double precision floating point decimal number while Double is single precision decimal number.
a) Only afirmation I is correct.
b) Only afirmation II is correct.
c) Both afirmations are correct.
d) Both afirmations are incorrect.

Essa pergunta também está no material:

23 pág.

Linguagem de Programação Java Universidade PaulistaUniversidade Paulista

💡 1 Resposta

User badge image

Ed Verified user icon

A diferença entre as variáveis double e float em Java é que o float ocupa 4 bytes na memória, enquanto o double ocupa 8 bytes. Além disso, o float é um número decimal de ponto flutuante de precisão dupla, enquanto o double é um número decimal de precisão simples. Portanto, a afirmativa I está correta e a afirmativa II está incorreta. A resposta correta é a letra d) - ambas as afirmações estão incorretas.

0
Dislike0

✏️ Responder

SetasNegritoItálicoSublinhadoTachadoCitaçãoCódigoLista numeradaLista com marcadoresSubscritoSobrescritoDiminuir recuoAumentar recuoCor da fonteCor de fundoAlinhamentoLimparInserir linkImagemFórmula

Para escrever sua resposta aqui, entre ou crie uma conta

User badge image

Outros materiais