TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
john
NA
12
0
Overloads
Nov 4 2003 1:51 PM
Quick and simple one. I know how to do overloads, that isn't really the question. The question is better explained by a couple samples. I know both of these methods work. What I want to know is what is the "RECOMMENDED" way of providing these defaults. Just trying to make the code right the first time so others can read it. A little work up front can save alot of work later. Sample #1 class { function void functiona(string x) : { functiona(x, "defaultstring"); } function void functiona(string x, string y) { /// some logic here } } Sample #2 class { private static string defaultString = "defaultstring"; function void functiona(string x) : { functiona(x, defaultString); } function void functiona(string x, string y) { /// some logic here } }
Reply
Answers (
1
)
Setup permission
casting at runtime