RU beehive logo ITEC dept promo banner
ITEC 120
2012fall
dbraffitt
ibarland

homeinfolectslabsexamshws
tutor/PIsbreeze (snow day)
Object120 + its docsjava.lang docsjava.util docs

lect07a
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/PIsbreeze (snow day)
Object120 + its docsjava.lang docsjava.util docs


©2012, Ian Barland, Radford University
Last modified 2012.Oct.08 (Mon)
Please mail any suggestions
(incl. typos, broken links)
to ibarlandradford.edu
Powered by PLT Scheme