java.lang
Class Void
 
java.lang.Object
  |
  +--java.lang.Void
 
 
 
public final class Void
extends Object
 
The Void class is an uninstantiable placeholder class to hold a reference to the Class object representing the Java keyword void.
 
Since:
 
JDK1.1
 

Field Summary
static Class TYPE
          The Class object representing the primitive Java type void.
 
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
 

Field Detail
TYPE
 
public static final Class TYPE
 

The Class object representing the primitive Java type void.
 
 

Wagner Levi!
----- Original Message -----
Sent: Wednesday, January 01, 2003 12:20
Subject: [java-list] void é tipo primitivo?

Pessoal,

surgiu uma duvida bastante intrigante, se em alguma prova tiver a seguinte questao:
void eh um tipo primitivo?
a resposta eh verdadeira ou falsa?
a duvida surgiu pois no livro "Thinking in Java" (segunda edicao), pagina 68, indica que void eh um tipo primitivo.
Porem no "The Java Language Specification -  second edition", pagina 286, tem:
"Note that the Java programming language does not allow a "cast to void"—void is not a type—so the traditional C trick of writing an _expression statement such as..."
e mais ainda na API de Java referente a classe Void tem o seguinte:
"The Void class is an uninstantiable placeholder class to hold a reference to the Class object representing the primitive Java type void."
fica entao a questao void eh tipo primitivo?
se void eh tipo primitivo, a classe Void eh uma Wrapper Class?
 

aguardo respostas,

Wagner



Busca Yahoo!
O melhor lugar para encontrar tudo o que você procura na Internet

Responder a