2:38 am - Friday April 19, 2019

Tag Archives: to

Java Example Program to find whether a Given Matrix is Diagonal Matrix or not

//Example Program to find whether a Given Matrix is Diagonal Matrix or not /** * @author:Candidjava.com * @description:Check the given matrix is diagonal or not */ public class Diagonal { public static void main(String args[]) { //...

Java Example Program to explain Pass By Reference to a Method

/*program to find whether the given number is odd or even*/ /** * @author:candidjava.com * @Description: check the given number to know whether it is odd or even */ public class TestPassByReference { public static void main(String[]...

Java Example Program to display Numbers from 1 to N using For Loop

/*program to print numbers from 1 to N*/ /** * @author:candidjava.com * @Description:here, we are using for loop to print numbrs from 1 to N */ class For { public static void main(String args[]) { int i = 1; int N = 15; for...

Cookie example program using setHttpOnly() method to set cookie as http only

Cookie example program using isHttpOnly() method to Check whether the cookie has been run only in http protocol

Cookie example program using getVersion()/setVersion() methods to Get/Set the version of current protocol

GetVersion.java package com.candidjava; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import...

Cookie example program using getValue()/setValue() methods to Get/Set the value of cookie

 GetValue.java package com.candid; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import...

Cookie example program using setSecure() method to Set the browser to send files only throw secure protocol

 SetSecure.java package com.candid; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import...

Cookie example program using getSecure()method to Check whether the browser send files only throw a secure protocol

GetSecure.java package com.candidjava; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import...

Cookie example program using getPath()/setPath to Get/Set the cookie path

GetPath.java package com.candidjava; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import...

Cookie example program using getName() to Get the name of the cookie

GetName.java package com.candidjava; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import...

Cookie example program using getMaxAge()/setMaxAge() method to Get/Set the maximum age of cookie in seconds

GetMaxAge.java package com.candidjava; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import...

Cookie example program using getDomain()/setDomain() method to Get/Set the domain name of cookie

GetDomain.java package com.candidjava; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import...

Cookie example program using getComment(), setComment() methods to get or set a comment

GetComment.java package com.candidjava; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import...

Integer Example Program for toString(int i,int radix)

/** *@author :candidjava.com *@descriptions : how to work with toString method isn (int I,int radix) variable */ public class ValueOf3 { public static void main(String args[]){ Integer x = 5; System.out.println(x.toString()); ...

Integer Example Program for toOctalString(int i)

/** *@author :candidjava.com *@descriptions : Assign the value in declared integer variable this integer value passing the toOctalString method.This method convert given the integer value to octal values. */ public class ToOctalStringEx...

Integer Example Program for toHexString(int i)

/** *@author :candidjava.com *@descriptions : Assign the value in declared integer variable this integer value passing the toHexString method.This method convert given the integer value to Hexa values. */ public class ToHexStringEx { public...

Integer Example Program for toBinaryString(int i)

/** *@author :candidjava.com *@descriptions : Assign the value in declared integer variable this integer value passing the toBinaryString method.This method convert given the integer value to binary values. */ public class ToBinaryStringEx...

Hibernate Association Mapping Using One-To-One to Fetching Data

Project Structure:                         JAR Files:                     Address.java: package com.candidjava; public class Address implements java.io.Serializable { private long addressId; private String...

Hibernate Association Mapping Using One-To-One to Inserting Data

Project Structure:                         JAR Files:                       CREATE THE FOLLOWING JAVA FILES AND POJO CLASS FILES:         Address.java: package com.candidjava; public class Address implements...