Re: get a URL from cmd line input. I am assuming that out.write(html); is what your talking about that "has a toString() method in it that returns it's entire contents as a String" although I stil get an error of "the method write(int) in the type BufferedWriter is not applicable for the arguments StringBuilder. This makes me think that "html" is still an integer and not converted to a string.
My original question of "to use the toURL() method" was not clear i guess or I'm not understanding your explination. I NEED to get from a string to a URL....but i dont have the STRING of the website until it is typed into the field before. Once the string is typed in...i need to take that string and convert to a URL.
OK
So you said.."The URL class (the one in the java.net package not the one you've written) has a constructor" and you gave an example "URL myURL=new URL("www.whatever.com");" but when i substitute my variable of "input" (which should contain the "website string") into the program i get an error of "The constructor URL(string) is undefined."
I'll ignore the error of "the method openconnection() is undefined for type URL until I can figure out how to read the URL in the previous part.
__________________
cheers
Aman
|