659). Which of these is a wrapper around everything associated with a reply from an http server?

[A]HTTP
[B]HttpResponse
[C]HttpRequest
[D]httpserver

Show Answer

660). Which of these transfer protocol must be used so that URL can be accessed by URLConnection class object?

[A]http
[B]https
[C]Any Protocol can be used
[D]None of the mentioned

Show Answer

663). Which of these data member of HttpResponse class is used to store the response from an http server?

[A]status
[B]address
[C]statusResponse
[D]statusCode

Show Answer

664). 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.sanfoundry.com/javamcq");
            URLConnection obj1 = obj.openConnection();
            System.out.print(obj1.getContentType());
        }
    }

[A]html
[B]text
[C] html/text
[D]text/html

Show Answer

665). 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.sanfoundry.com/javamcq");
            URLConnection obj1 = obj.openConnection();
            int len = obj1.getContentLength();
            System.out.print(len);
        }
    }

[A]126
[B]127
[C]Compilation Error
[D]Runtime Error

Show Answer

666). 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.sanfoundry.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

Show Answer