Successfully reported this slideshow.
Java Programming: From Problem Analysis to Program Design, 4e Chapter 7 Passing Primitive Types As Objects
<ul><li>Java provides the classes  Integer ,  Double ,  Character ,  Long , and  Float  so that the values of the primitiv...
Java Programming: From Problem Analysis to Program Design, 4e
Java Programming: From Problem Analysis to Program Design, 4e
Java Programming: From Problem Analysis to Program Design, 4e
Java Programming: From Problem Analysis to Program Design, 4e
Java Programming: From Problem Analysis to Program Design, 4e
Java Programming: From Problem Analysis to Program Design, 4e Sample Run:  In this sample run, the user input is shaded Li...
Java Programming: From Problem Analysis to Program Design, 4e
Java Programming: From Problem Analysis to Program Design, 4e
Java Programming: From Problem Analysis to Program Design, 4e
Java Programming: From Problem Analysis to Program Design, 4e
Java Programming: From Problem Analysis to Program Design, 4e
Java Programming: From Problem Analysis to Program Design, 4e
Java Programming: From Problem Analysis to Program Design, 4e num1 = 10;  //Line 5
Java Programming: From Problem Analysis to Program Design, 4e num1 = 10;  //Line 5 num2.setNum(15);  //Line 6 ch = 'A';  /...
Java Programming: From Problem Analysis to Program Design, 4e
Java Programming: From Problem Analysis to Program Design, 4e num = b.getNum();  //Line 14
Java Programming: From Problem Analysis to Program Design, 4e
Java Programming: From Problem Analysis to Program Design, 4e
Java Programming: From Problem Analysis to Program Design, 4e
Java Programming: From Problem Analysis to Program Design, 4e
Java Programming: From Problem Analysis to Program Design, 4e
Java Programming: From Problem Analysis to Program Design, 4e
Java Programming: From Problem Analysis to Program Design, 4e
Java Programming: From Problem Analysis to Program Design, 4e
Upcoming SlideShare
Loading in …5
×

9781439035665 ppt ch07_passing_primitivetypeasobjects

835 views

Published on

  • Be the first to comment

  • Be the first to like this

9781439035665 ppt ch07_passing_primitivetypeasobjects

  1. 1. Java Programming: From Problem Analysis to Program Design, 4e Chapter 7 Passing Primitive Types As Objects
  2. 2. <ul><li>Java provides the classes Integer , Double , Character , Long , and Float so that the values of the primitive data types can be treated as objects </li></ul><ul><li>These classes have limitations </li></ul><ul><li>You can create objects of the type, say Integer, to store int values, but you cannot change the values stored in the objects </li></ul><ul><li>You can create objects of type IntClass and/or change the values of the objects </li></ul>Java Programming: From Problem Analysis to Program Design, 4e
  3. 3. Java Programming: From Problem Analysis to Program Design, 4e
  4. 4. Java Programming: From Problem Analysis to Program Design, 4e
  5. 5. Java Programming: From Problem Analysis to Program Design, 4e
  6. 6. Java Programming: From Problem Analysis to Program Design, 4e
  7. 7. Java Programming: From Problem Analysis to Program Design, 4e
  8. 8. Java Programming: From Problem Analysis to Program Design, 4e Sample Run: In this sample run, the user input is shaded Line 1: Based on the course score, this program computes the course grade. Line 5: Enter the course score: 90.50 Line 9: The course score is 90.5 Line 10: Your grade for the course is A
  9. 9. Java Programming: From Problem Analysis to Program Design, 4e
  10. 10. Java Programming: From Problem Analysis to Program Design, 4e
  11. 11. Java Programming: From Problem Analysis to Program Design, 4e
  12. 12. Java Programming: From Problem Analysis to Program Design, 4e
  13. 13. Java Programming: From Problem Analysis to Program Design, 4e
  14. 14. Java Programming: From Problem Analysis to Program Design, 4e
  15. 15. Java Programming: From Problem Analysis to Program Design, 4e num1 = 10; //Line 5
  16. 16. Java Programming: From Problem Analysis to Program Design, 4e num1 = 10; //Line 5 num2.setNum(15); //Line 6 ch = 'A'; //Line 7 str = new StringBuffer(&quot;Sunny&quot;); //Line 8
  17. 17. Java Programming: From Problem Analysis to Program Design, 4e
  18. 18. Java Programming: From Problem Analysis to Program Design, 4e num = b.getNum(); //Line 14
  19. 19. Java Programming: From Problem Analysis to Program Design, 4e
  20. 20. Java Programming: From Problem Analysis to Program Design, 4e
  21. 21. Java Programming: From Problem Analysis to Program Design, 4e
  22. 22. Java Programming: From Problem Analysis to Program Design, 4e
  23. 23. Java Programming: From Problem Analysis to Program Design, 4e
  24. 24. Java Programming: From Problem Analysis to Program Design, 4e
  25. 25. Java Programming: From Problem Analysis to Program Design, 4e
  26. 26. Java Programming: From Problem Analysis to Program Design, 4e

×