Java Programming: From Problem Analysis to Program Design, 5e 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, 5e
Java Programming: From Problem Analysis to Program Design, 5e
Java Programming: From Problem Analysis to Program Design, 5e
Java Programming: From Problem Analysis to Program Design, 5e
Java Programming: From Problem Analysis to Program Design, 5e
Java Programming: From Problem Analysis to Program Design, 5e Sample Run:  In this sample run, the user input is shaded Li...
Java Programming: From Problem Analysis to Program Design, 5e
Java Programming: From Problem Analysis to Program Design, 5e
Java Programming: From Problem Analysis to Program Design, 5e
Java Programming: From Problem Analysis to Program Design, 5e
Java Programming: From Problem Analysis to Program Design, 5e
Java Programming: From Problem Analysis to Program Design, 5e
Java Programming: From Problem Analysis to Program Design, 5e num1 = 10;  //Line 5
Java Programming: From Problem Analysis to Program Design, 5e num1 = 10;  //Line 5 num2.setNum(15);  //Line 6 ch = 'A';  /...
Java Programming: From Problem Analysis to Program Design, 5e
Java Programming: From Problem Analysis to Program Design, 5e num = b.getNum();  //Line 14
Java Programming: From Problem Analysis to Program Design, 5e
Java Programming: From Problem Analysis to Program Design, 5e
Java Programming: From Problem Analysis to Program Design, 5e
Java Programming: From Problem Analysis to Program Design, 5e
Java Programming: From Problem Analysis to Program Design, 5e
Java Programming: From Problem Analysis to Program Design, 5e
Java Programming: From Problem Analysis to Program Design, 5e
Java Programming: From Problem Analysis to Program Design, 5e
Upcoming SlideShare
Loading in...5
×

9781111530532 ppt ch07_passing_primitivetypeasobjects

378

Published on

Published in: Technology, News & Politics
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
378
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
13
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

9781111530532 ppt ch07_passing_primitivetypeasobjects

  1. 1. Java Programming: From Problem Analysis to Program Design, 5e 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, 5e
  3. 3. Java Programming: From Problem Analysis to Program Design, 5e
  4. 4. Java Programming: From Problem Analysis to Program Design, 5e
  5. 5. Java Programming: From Problem Analysis to Program Design, 5e
  6. 6. Java Programming: From Problem Analysis to Program Design, 5e
  7. 7. Java Programming: From Problem Analysis to Program Design, 5e
  8. 8. Java Programming: From Problem Analysis to Program Design, 5e 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, 5e
  10. 10. Java Programming: From Problem Analysis to Program Design, 5e
  11. 11. Java Programming: From Problem Analysis to Program Design, 5e
  12. 12. Java Programming: From Problem Analysis to Program Design, 5e
  13. 13. Java Programming: From Problem Analysis to Program Design, 5e
  14. 14. Java Programming: From Problem Analysis to Program Design, 5e
  15. 15. Java Programming: From Problem Analysis to Program Design, 5e num1 = 10; //Line 5
  16. 16. Java Programming: From Problem Analysis to Program Design, 5e 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, 5e
  18. 18. Java Programming: From Problem Analysis to Program Design, 5e num = b.getNum(); //Line 14
  19. 19. Java Programming: From Problem Analysis to Program Design, 5e
  20. 20. Java Programming: From Problem Analysis to Program Design, 5e
  21. 21. Java Programming: From Problem Analysis to Program Design, 5e
  22. 22. Java Programming: From Problem Analysis to Program Design, 5e
  23. 23. Java Programming: From Problem Analysis to Program Design, 5e
  24. 24. Java Programming: From Problem Analysis to Program Design, 5e
  25. 25. Java Programming: From Problem Analysis to Program Design, 5e
  26. 26. Java Programming: From Problem Analysis to Program Design, 5e
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×