How To Get URL Object With Relative Path In Java?

Description:

In your Java programs, you can create a URL object from a relative URL specification. This will be useful if you have same URL and
has to query with multiple relative paths, then you create common URL object and create seperate URL objects for relative paths using commin URL object.
Below example shows how to create URL object using relative path.

About Author

I'm Nataraja Gootooru, programmer by profession and passionate about technologies. All
examples given here are as simple as possible to help beginners. The source code is compiled and tested in my dev environment.