Write the output for the following Java code Segment. try { URL u = new URL("https://bb.cas.edu.om/webapps/assessment/do/authoring/modifyShortQuestion?course_id=_143_1"); System.out.println("1. The Protocol is " + u.getProtocol()); System.out.println("2. The user info is " + u.getUserInfo()); System.out.println("3. The host is " + u.getHost()); System.out.println("4. The Port Address is " + u.getPort()); System.out.println("5. The File is " + u.getFile()); System.out.println("6. The Query string is " + u.getQuery()); System.out.println("7. The Path is " + u.getPath()); System.out.println("8. The Authority is " + u. getAuthority()); } catch (MalformedURLException ex) { System.err.println(" I do not understand the URL"); }
Write the output for the following Java code Segment.
try {
URL u = new URL("https://bb.cas.edu.om/webapps/assessment/do/authoring/modifyShortQuestion?course_id=_143_1");
System.out.println("1. The Protocol is " + u.getProtocol());
System.out.println("2. The user info is " + u.getUserInfo());
System.out.println("3. The host is " + u.getHost());
System.out.println("4. The Port Address is " + u.getPort());
System.out.println("5. The File is " + u.getFile());
System.out.println("6. The Query string is " + u.getQuery());
System.out.println("7. The Path is " + u.getPath());
System.out.println("8. The Authority is " + u. getAuthority());
} catch (MalformedURLException ex) {
System.err.println(" I do not understand the URL");
}
Step by step
Solved in 2 steps