Java Notes
Wednesday, July 6, 2011
Connect gmail with java application
This is done by using pop3 (Post Office Protocol). POP is the mechanism most people on the Internet use to get their mail. Click here to download sample code.You can open & run it with netbeans.
Tuesday, July 5, 2011
Define constant in java
class Example3
{
static final double KMS_PER_MILE = 1.609; //way of define constant
static final double YARD_PER_MILE = 1/1760.0;
public static void main(String args[])
{
double kilo;
int yards = 385;
int miles =26;
kilo = (((YARD_PER_MILE*yards)+miles)*KMS_PER_MILE);
System.out.println("Kilomters ="+kilo+"Km");
}
}
{
static final double KMS_PER_MILE = 1.609; //way of define constant
static final double YARD_PER_MILE = 1/1760.0;
public static void main(String args[])
{
double kilo;
int yards = 385;
int miles =26;
kilo = (((YARD_PER_MILE*yards)+miles)*KMS_PER_MILE);
System.out.println("Kilomters ="+kilo+"Km");
}
}
Subscribe to:
Posts (Atom)