What will be the output of the following Java program?
import java.net.*;
class networking
{
public static void main(String[] args) throws Exception
{
URL obj = new URL("https://www.example.com/javamcq");
URLConnection obj1 = obj.openConnection();
System.out.print(obj1.getLastModified);
}
}
Note: Host URL was last modified on june 18 tuesday 2013.
import java.net.*;
class networking
{
public static void main(String[] args) throws Exception
{
URL obj = new URL("https://www.example.com/javamcq");
URLConnection obj1 = obj.openConnection();
System.out.print(obj1.getLastModified);
}
}
A. june
B. 18-6-2013
C. Tue 18 Jun 2013
D. Tue Jun 18 2013
Answer: Option D
A. The process of converting an object into a byte stream
B. The process of converting a byte stream into an object
C. The process of converting an object into a text file
D. The process of converting a text file into an object
Which interface in Java is used to mark a class as serializable?
A. `MarkSerializable`
B. `SerializableClass`
C. `Serialize`
D. `Serializable`
What is the purpose of the `ObjectOutputStream` class in Java Serialization?
A. To read objects from an input stream
B. To convert objects to text format
C. To write objects to an output stream
D. To serialize primitive data types
A. It indicates that the variable is mandatory for serialization
B. It indicates that the variable should not be serialized
C. It indicates that the variable should be ignored during deserialization
D. It indicates that the variable is mandatory for serialization
Join The Discussion