Pages
Home
Way to Successful Doctorate Stories
Don't Touch - Am ENGLISH
Web Technology In-Built Lab
Contact
Thursday, September 8, 2011
Anonymous Objects
It is possible to construct anonymous objects for our own class types. This is done by creating objects like normal, but omitting the variable name.
1
Cents cCents(5);
// normal variable
2
Cents(7);
// anonymous variable
In the above code,
Cents(7)
will create an anonymous Cents object, initialize it with the value 7, and then destroy it.
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment