Networking


  1. Which of these method is called when http daemon is acting like a normal web server?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    handleGet()


  1. Which of these method is used to start a server thread?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    run() method is called when the server thread is started.



  1. What is the output of this program?
    import java.net.*;
    public class networking_Length
    {
    public static void main(String[] args) throws Exception
    {
    URL object = new URL("https://www.interviewmania.com/java/programming");
    URLConnection object0 = object.openConnection();
    int length = object0.getContentLength();
    System.out.print(length);
    }
    }

    Note: Host URL is having length of content 256.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    256


  1. Which of these method of httpd class is used to write UrlCacheEntry object into local disk?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    The writeDiskCache() method takes an UrlCacheEntry object and writes it persistently into the local disk. It constructs directory names out of URL, making sure to replace the slash(/) characters with system dependent seperatorChar.



  1. Which of these variables stores the number of hits that are successfully served out of cache?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    hitstocache