Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Java: How to compare File Dates

import java.io.File;
public class File_Date
{
  private static String compare_File(String fichier1, String fichier2)
  {
  	String result="";
  	long

Java: get string Hash Code

public class StringHashCode {
  public static void main(String[] args) {
    System.out.println("Welcom".hashCode());
    System.out.println("sak

JavaMail: How to use the FileDataSource class to send a file via email

import java.util.*;
import java.io.*;
import javax.mail.*;
import javax.mail.internet.*;
import javax.activation.*;
public class EmailsAttachFile
{

Java: How to determining If a Year Is a Leap Year

import java.util.GregorianCalendar;
public class LeapYear
{
  public static void main(String[] argv) throws Exception
  {
    GregorianCalendar

Java: How to write a client to use an RMI service

import java.rmi.*;
import java.util.*;
public class RMIClient
{
    protected static RMIContract RMIClt = null;
    public static void main(String[]

Java: How to get the free space

import java.io.File;
public class DiskFreeSpace
 {
  public static void main(String[] args)
 {
    File[] racines = File.listRoots();
    for (i

Java: How to Use break with a foreach loop.

public class BreakForEach {
  public static void main(String args[]) {
    int sum = 0;
    int values[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };

Java: How to use multiple expressions in for loops

public class ForLoopExample 
{
  public static void main(String[] args) 
   {
    for (int i = 0, j = 0; i < 5; i++, j--)
      System.out.println

Java: How to Add or subtract days to current date using Java Calendar

import java.util.Calendar;
public class DateOperation {
  public static void main(String[] args)
  {
    Calendar today = Calendar.getInstance()

Java: How to use unsigned right shift.

public class ShiftUR {
  public static void main(String[] args) {
    int i = -1;
    System.out.println(i >>>= 10);
    long l = -1;
    System

Java: Getting URL from a File Object

import java.io.*;
import java.net.*;
public class FileURL
 {
  public static void main(String args[]) throws MalformedURLException {
    File fi

Java: list main method parameters

public class Main {
  public static void main(String... args) 
  {
    for (String arg : args) 
    {
      System.out.println(arg);
    }
  }

Java: Formatting time and date with Formatter class

import java.util.Calendar;
import java.util.Formatter;
public class FormatDateTime
 {
    public static void main(String args[]) {
      Formatter

Java: set a file to read-only.

import java.io.File;
import java.io.IOException;
public class FichierModeEcriture {
    public static void main (String[] args) throws IOExceptio

Java: How to use if Else statements

public class IfElseDemo {
    public static void main(String[] args) {
        double note = 69;
        String mention="";
        if (note >=