Vidyalelo
Java Programming · Q100

Java Serialization and Networking

Programming · Java Programming · question 100

Q100

What will be the output of the following Java program? import java.net.*; class networking public static void main(String[] args) throws MalformedURLException URL obj = new URL("https://www.example.com/javamcq"); System.out.print(obj.getPort());

A.
1
B.
0
C.
-1
Answer
D.
garbage value

Answer: Option C

Solution

Answer: Option C
No explanation is given for this question Let's Discuss on Board