-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Stephan Freund wrote:
Hi,
Why does not implement the class java.net.URL the method clone()
(and does not implement the interface clonable)?
Thank you
cu Stephan
Hello,
I would think that since java.net.URL is immutable, there is no reason
to clone it. Just like java.lang.String, if there's no way you can
change the contents of the object, there is no reason you could ever
want a copy made of it (it would be a waste of resources). Instead,
just make a copy of the reference to the same object, since it has
the same practical value in this case.
- --
Chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
iD8DBQE/JOxZwxczzJRavJYRAp+5AJwMxf1j0mFDZrqUNzxi5AGDCHr5Yg CeM+8N
P2jC83lss1JwFQhyT4vaxLM=
=KJxG
-----END PGP SIGNATURE-----