/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
import java.net.URL;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
// your code goes here
URL server
= new URL("https://r...content-available-to-author-only...e.com/1/"); System.
out.
println(new URL(server, path
).
toString());
server
= new URL("https://r...content-available-to-author-only...e.com/1/"); path = "path";
System.
out.
println(new URL(server, path
).
toString());
server
= new URL("https://r...content-available-to-author-only...e.com/1"); path = "/path";
System.
out.
println(new URL(server, path
).
toString());
server
= new URL("https://r...content-available-to-author-only...e.com/1"); path = "path";
System.
out.
println(new URL(server, path
).
toString()); }
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CmltcG9ydCBqYXZhLm5ldC5VUkw7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJCS8vIHlvdXIgY29kZSBnb2VzIGhlcmUKICAgICAgCVVSTCBzZXJ2ZXIgPSBuZXcgVVJMKCJodHRwczovL3IuLi5jb250ZW50LWF2YWlsYWJsZS10by1hdXRob3Itb25seS4uLmUuY29tLzEvIik7CiAgCQlTdHJpbmcgcGF0aCA9ICIvcGF0aCI7CiAgCQlTeXN0ZW0ub3V0LnByaW50bG4obmV3IFVSTChzZXJ2ZXIsIHBhdGgpLnRvU3RyaW5nKCkpOwogIAkJCiAgCQlzZXJ2ZXIgPSBuZXcgVVJMKCJodHRwczovL3IuLi5jb250ZW50LWF2YWlsYWJsZS10by1hdXRob3Itb25seS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