Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
/**
*Demonstrates the creaion of objects and their initialization
*using constructors
*
*@author Brandon Mowery
*@version September 13, 2017
*/
import java.util.Random;
import java.math.BigInteger;
import java.net.HttpCookie;
import java.util.GregorianCalendar;
public class ConstructorDemo{
public static void main(String [] args){
Random rand = new Random();
/*
like saying
Random rand;
rand = new Random();
*/
BigInteger num = new BigInteger("789890778965453132467954132");
HttpCookie cookie = new HttpCookie("username", "bmowery");
GregorianCalendar today = new GregorianCalendar();
GregorianCalendar bDay = new GregorianCalendar(1999, 02, 10);
}
}
Advertisements
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.
AcceptLearn more