O GoConqr está de visual novo! Conte para nós o que você achou.

Flashcards

Wrapper Classes

Nathan Hunsdale Programming 2 Masters of Science Inglês 13 flashcards

Wrapper Classes

Flashcards do conjunto (13)

  1. 1Wrapper Classes What does each of the 8 primitive data types have dedicated to it?A Class
  2. 2Wrapper Classes Why are they known as wrapper classes?They "wrap" the primitive data types into an object of that class
  3. 3Wrapper Classes What package are the wrapper classes a part of?java.lang
    (imported by default into all Java programs)
  4. 4Wrapper Classes What are the 2 primary purposes?1) Wrap primitive values into an object for more functionality (e.g. be added to ArrayLists)
    2) Provide a lot more utility functions (e.g. converting ints to and from Strings)
  5. 5Wrapper Classes Declare an int... Declare an Integerint primitiveInt = 25;
    Integer wrapperInt = new Integer(25);
  6. 6Wrapper Classes with constructor detailsWrapper Classes with constructor details
  7. 7Wrapper Classes All wrapper classes except ______ can take ________ as an argument for example...1) Character
    2) String
    Integer num = new Integer("25");
  8. 8Wrapper Classes What is the NumberFormatException?When someone tries to pass the number spelled out as a string rather than the integer form
    e.g. "two" instead of "2"
  9. 9Wrapper Classes Primitive data uses ==,<,> and wrapper classes use_________ and ________equals() and compareTo()
  10. 10What are the possible results from equals() or compareTo()?1, 0 ,-1
  11. 11Wrapper Classes write a compareTo statement...integer1.compareTo(integer2);
  12. 12Wrapper Classes Autoboxing and Auto-Unboxing What do these functions do?Provide automatic conversion TO and FROM the wrapper format
  13. 13Wrapper Classes Autoboxing int m = 20; Integer objM; How would I box int m?objM = m;

Informações

Descrição
Masters of Science Programming 2 FlashCards sobre Wrapper Classes, criado por Nathan Hunsdale em 28-05-2014.
Criado por
Nathan Hunsdale
Visualizações
16
Avaliação

Fale Conosco

Sobre o que é sua mensagem?

O que você acha do novo visual?

Você gostou?