RU beehive logo ITEC dept promo banner
ITEC 120
2010fall
ibarland

homeinfolectslabsexamshws
tutor/PIsObject120 + its docsjava.lang docsjava.util docs

lect06c
constructors; named constants
Mysteries Revealed!


1 Note how we're declaring and initializing on the same line; we'll need that fact in a moment.      

2Well, actually Java tries to re-use literally defined Strings, so if your program contains the String literal “"hello"” five times, it only calls a String constructor once (and at compile-time, not run-time).      

3 Why on earth would you ever want to treat an int as an object? Because some functions can work on any Object. For example, toString and equals actually work on any Objects!      

homeinfolectslabsexamshws
tutor/PIsObject120 + its docsjava.lang docsjava.util docs


©2010, Ian Barland, Radford University
Last modified 2010.Oct.10 (Sun)
Please mail any suggestions
(incl. typos, broken links)
to iba�rlandrad�ford.edu
Powered by PLT Scheme