Question 1 of 25
Hints left: 3
Q1
Which of these is method of ObjectOutput interface used to write the object to input or output stream as required?
Q2
Which of these is a bundle of information passed between machines?
Q3
Which of these is an instance variable of class httpd?
Q4
Which of these methods of DatagramPacket is used to find the length of byte array?
Q5
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.getHost()); } }
Q6
What will be the output of the following Java program? import java.net.*; class networking { public static void main(String[] args) throws UnknownHostException { InetAddress obj1 = InetAddress.getByName("example.com"); InetAddress obj2 = InetAddress.getByName("example.com"); boolean x = obj1.equals(obj2); System.out.print(x); } }
Q7
What will be the output of the following Java program? import java.io.*; class streams { public static void main(String[] args) { try { FileOutputStream fos = new FileOutputStream("serial"); ObjectOutputStream oos = new ObjectOutputStream(fos); oos.writeFloat(3.5); oos.flush(); oos.close(); } catch(Exception e) { System.out.println("Serialization" + e); System.exit(0); } try { FileInputStream fis = new FileInputStream("serial"); ObjectInputStream ois = new ObjectInputStream(fis); System.out.println(ois.available()); } catch (Exception e) { System.out.print("deserialization"); System.exit(0); } } }
Q8
Which of these method of DatagramPacket is used to find the port number?
Q9
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.toExternalForm()); } }
Q10
Which of these method of DatagramPacket class is used to find the destination address?
Q11
Which of these class is used to access actual bits or content information of a URL?
Q12
Which of these process occur automatically by the java runtime system?
Q13
What is deserialization?
Q14
What will be the output of the following Java program? import java.net.*; public class networking { public static void main(String[] args) throws UnknownHostException { InetAddress obj1 = InetAddress.getByName("cisco.com"); InetAddress obj2 = InetAddress.getByName("example.com"); boolean x = obj1.equals(obj2); System.out.print(x); } }
Q15
Which of these exceptions is thrown by URL class's constructors?
Q16
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(); int len = obj1.getContentLength(); System.out.print(len); } } Note: Host URL is having length of content 127.
Q17
Which of these variables stores the number of hits that are successfully served out of cache?
Q18
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(); int len = obj1.getContentLength(); System.out.print(len); } } Note: Host URL is having length of content 127.
Q19
Which of these class must be used to send a datagram packets over a connection?
Q20
Which of these methods of httpd class is used to read data from the stream?
Q21
Which of these method is called when http daemon is acting like a normal web server?
Q22
Which of these method of MimeHeader is used to return the string equivalent of the values stores on MimeHeader?
Q23
Which of these interface extends DataInput interface?
Q24
What type of members are not serialized?
Q25
What will be the output of the following Java program? import java.io.*; class streams { public static void main(String[] args) { try { FileOutputStream fos = new FileOutputStream("serial"); ObjectOutputStream oos = new ObjectOutputStream(fos); oos.writeFloat(3.5); oos.flush(); oos.close(); } catch(Exception e) { System.out.println("Serialization" + e); System.exit(0); } try { FileInputStream fis = new FileInputStream("serial"); ObjectInputStream ois = new ObjectInputStream(fis); ois.close(); System.out.println(ois.available()); } catch (Exception e) { System.out.print("deserialization"); System.exit(0); } } }