|
|
||
| 1. Variables in java |
|
|
|
||
|
|
||
| 3. Boolean example |
|
|
|
||
|
|
||
| 4. Boolean comments |
|
|
|
||
|
|
||||||||||||
| 5. Characters (char) |
|
|||||||||||
|
||||||||||||
|
|
||
| 6. Char Examples |
|
|
|
||
|
|
||
| 7. Char Notes |
|
|
|
||
|
|
||||||||||||
| 8. byte |
|
|||||||||||
|
||||||||||||
|
|
||||||||||||
| 9. int |
|
|||||||||||
|
||||||||||||
|
|
||||||||||||
| 10. long |
|
|||||||||||
|
||||||||||||
|
|
||
| 11. Examples of integer types |
|
|
|
||
|
|
||
| 12. Notes on integer types |
|
|
|
||
|
|
||
| 13. More on integers |
|
|
|
||
|
|
||||||||||||
| 14. Float |
|
|||||||||||
|
||||||||||||
|
|
||||||||||||
| 15. double |
|
|||||||||||
|
||||||||||||
|
|
||
| 16. Casting primitives |
|
|
|
||
|
|
||
| 17. postfix identifiers |
|
|
|
||
|
|
||
| 18. Strings |
|
|
|
||
|
|
||
| 19. Wrapper objects |
|
|
|
||
|
|
||
| 20. Wrapper examples |
|
|
|
||
|
|
||
| 21. Converting primitives to String |
|
|
|
||
|
|
||
| 22. primitive to string examples |
|
|
|
||
|
|
||
| 23. Strings to primitives |
|
|
|
||
|
|
||
| 24. More on String to Primitive conversion |
|
|
|
||
|
|
||
| 25. Warning about Wrapper objects!!! |
|
|
|
||
|
|
||
| 26. Pass by reference, pass by value |
|
|
|
||
|
|
||
| 27. Circle 1 |
|
|
|
|
||
|
|
||
| 28. Comments on circle1 |
|
|
|
||
|
|
||
| 29. Circle 2 |
|
|
|
|
||
|
|
||
| 30. Comments on circle 2 |
|
|
|
||
|
|
||
| 31. Circle 3 |
|
|
|
|
||
|
|
||
| 32. Comments on circle 3 |
|
|
|
||
|
|
||
| 33. Circle 4 |
|
|
|
|
||
|
|
||
| 34. Comments on circle 4 |
|
|
|
||
|
|
||
| 35. Circle 5 |
|
|
|
|
||
|
|
||
| 36. Comments on circle 5 |
|
|
|
||
|
|
||
| 37. Circle 6 |
|
|
|
|
||
|
|
||
| 38. Comments on Circle 6 |
|
|
|
||
|
|
||
| 39. Input and output |
|
|
|
||
|
|
||
| 40. I/O examples |
|
|
|
||
| name | boolean |
|---|---|
| length | 1 byte |
| legal values | true or false (no caps) |
| default value | false |
| operations | Can be used ONLY in boolean operations (=, ==, !=, !, &, &&, |, ||, ^, ?:) |
boolean continue = true;
while (continue){
//code goes here...
if(continue){
//code goes here...
continue = false
}// end if
} // end while
| name | char |
|---|---|
| length | 16 bit (only ONE character) |
| legal values | unicode (ASCII + extensions) |
| default value | \u0000 (null character) |
| operations | any of the typical operations assignment boolean including if , while, for, switch it can be cast into other primative types (although it might lose some information) |
| name | byte |
|---|---|
| length | 8 bits |
| legal values | -128 to 127 |
| default value | 0 |
| operations | Any operations, but boolean operations ALWAYS produce a boolean result |
| name | int |
|---|---|
| length | 32 bits |
| legal values | -2,147,483,648 to 2,147,483,647 |
| default value | 0 |
| operations | Any operations, but boolean operations ALWAYS produce a boolean result |
| name | long |
|---|---|
| length | 64 bits |
| legal values | -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 |
| default value | 0 |
| operations | Any operations, but boolean operations ALWAYS produce a boolean result |
| name | float |
|---|---|
| length | 4 bytes |
| legal values | @ 2 to +/- 38 |
| default value | 0.0f |
| operations | Can be used for assignment, comparison. Can be cast to other primitive types, but may lose value |
| name | double |
|---|---|
| length | 8 bytes |
| legal values | @ 2 to +/- 300 |
| default value | 0.0d |
| operations | Can be used for assignment, comparison. Can be cast to other primitive types, but may lose value |