One thing I noticed is that you can have multiple attributes, of which they can be the same type. I think it may be better to store them in some sort of collection, instead of instance variables.
The way it is written now, sequential calls to addArgument() will step on each other.
Henry
I think i see what your saying. having the multiple calls to addArgument in MyUrl can cause problems enven with then 2nd value either being string, int or double. I was thinking on something like a toString method on the double and int similar to what i did on a prev assignment but that's not going quite so well.
My overall understanding on OOP is pretty decent. I haven't touched codes in almost 2 years since my last programming classes. I've taken VB .NET for 2 semesters and C. I was pretty decent with C and not too bad with VB. I had taken C++ but ended up dropping the class because I was running into issues like now. Where the teacher was like here is the assignment and the class is like 'Huh?' No lectures, no books, nothing.
So what MyURl should be doing in my opinion is, to take the url that is entered, ex.
www.yahoo.com and first change it to
http://www.yahoo.com/. I have somewhat a grasp on this but haven't taken this on yet since i wanted to get the hard part (for me) out of the way. Then it should take info that is passed from MyUrlDemo, the names should be a string, if the value is a string, or int or double, return those values with the name, appending it to the url. then the url will be encoded after
http://www.yahoo.com/ (this i can do and have a few ideas on this too.
also after
http://www.yahoo.com/ a ? should be place then the arguments. in between each argument should be separated with &. So the url encoding should be done before it's appended to the Url string.
I did take out the other two addArguments and have been monkeying around with the value portion of it.
but i end up getting this error on MyUrlDemo in the snippet of code below.
The method addArgument(String, String in the type MyUrl is not applicable for the arguments (String, int) or
The method addArgument(String, String in the type MyUrl is not applicable for the arguments (String, double)
I know this will become much easier with time and practice, but for me right now this seems like the most difficult thing i've encounted in programming. Nothing like my C or VB .NET class, but then again in those classes, We had decent help
Thanks for all the help, or i'd still be pulling out my hair.
