HttpCookie GetDiscard() Example

Return the discard attribute of the cookie


HttpCookieclass GetDiscard() method example. This example shows you how to use GetDiscard() method.This method Return the discard attribute of the cookie

Here is the code:-
/* 
 * @Program that Return the discard attribute of the cookie
 * GetDiscard.java 
 * Author:-RoseIndia Team
 * Date:-25-Jun-2008
 */

import java.net.*;

public class GetDiscard {

    public static void main(String[] argsthrows Exception {
        String name = "Name";
        String value = "ABC";
        HttpCookie hc = new HttpCookie(name, value);
        //Return the discard attribute of the cookie
        System.out.println("Discard attribute of the cookie is :" + hc.getDiscard());
    }
}

Output of the program:-
 Discard attribute of the cookie is :false

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

HOME | COPYRIGHT | CONTACT US