Question 1 of 25
Hints left: 3
Q1
Which of these is an instance variable of class httpd?
Q2
Which of these method is called when http daemon is acting like a normal web server?
Q3
What is deserialization?
Q4
Which of these method of MimeHeader is used to return the string equivalent of the values stores on MimeHeader?
Q5
What type of members are not serialized?
Q6
Which of these interface extends DataInput interface?
Q7
Which of these method of DatagramPacket class is used to find the destination address?
Q8
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.
Q9
Which of these methods of DatagramPacket is used to find the length of byte array?
Q10
Which of these is a bundle of information passed between machines?
Q11
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); } } }
Q12
Which of these methods of httpd class is used to read data from the stream?
Q13
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()); } }
Q14
Which of these class must be used to send a datagram packets over a connection?
Q15
Which of these class is used to access actual bits or content information of a URL?
Q16
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); } }
Q17
Which of these exceptions is thrown by URL class's constructors?
Q18
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); } }
Q19
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()); } }
Q20
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.
Q21
Which of these method of DatagramPacket is used to find the port number?
Q22
Which of these variables stores the number of hits that are successfully served out of cache?
Q23
Which of these process occur automatically by the java runtime system?
Q24
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); } } }
Q25
Which of these is method of ObjectOutput interface used to write the object to input or output stream as required?