Static Class Features
You can prepend the keyword "static" to either a variable or a method.
This variable or method is associated with the class and not with an object.
A class with only static members is called a utility.
Utilities and Constructors
If a utility has no constructor, it is legal to create an object of that type.
All classes have a default constructor automatically (with no parameters).
You can override the default constructor with our own default constructor, and make the constructor private.
Other notes:
It is perfectly legal to include a constructor in a utility class, however it does not much a lot of sense to instantiate one. This is why we commonly make the default constructor, if and when we include it, private.
I will also eventually post code from class up here, but I'd encourage writing it on your own.
Welcome
Welcome to my blog.
I will be updating this blog with lecture notes and miscellaneous information for:
Prof. A. Eckford, Section-Z: MWF at 10:30 in R S137
Feel free to leave me a message or send me an e-mail at producap@yorku.ca.
Here is a link for MyMail, Hotmail, G-mail, and PRISM login.
On that note, you must have a PRISM account in order to write the lab tests.
If you have not created a PRISM account yet (e.g., if you received transfer credit for 1020), see the lab monitor in CSEB 1006 as soon as possible.
I will also leave the blog open to comments, etc. much like the CSE forums.
Thanks for visiting.
Phil.
Wednesday, January 9, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment