HttpCookie GetVersion() Example

Returns the version of the protocol this cookie complies with.


HttpCookieclass GetVersion() method example. This example shows you how to use GetVersion() method.This method Returns the version of the protocol this cookie complies with.

Here is the code:-
/* 
 * @Program that Returns the version of the protocol this cookie complies with.
 * GetVersion.java 
 * Author:-RoseIndia Team
 * Date:-25-Jun-2008
 */

import java.net.*;

public class GetVersion {

    public static void main(String[] argsthrows Exception {
        String name = "Roseindia";
        String value = "ABC";
        HttpCookie hc = new HttpCookie(name, value);
        //Returns the version of the protocol this cookie complies with.
        System.out.println("Version of the protocol is: " + hc.getVersion());
    }
}

Output of the program:-
 Version of the protocol is: 1

Post Comment
Name:
E-mail:
Contact no :
Comments:
  Refresh Image
Verify Image:
 
 
Your Comment's
 
 
 

HOME | COPYRIGHT | CONTACT US