trupti.k
util packages in java
1 Answer(s)      3 years and a month ago
Posted in : Java Beginners

write a java program to display present date and after 25days what will be the date?

Advertisement
View Answers

March 23, 2012 at 11:34 AM


import java.util.*;
import java.text.*;
class FindDate{
    public static void main(String[] args){
        Date today = new Date();
        SimpleDateFormat sdf=new SimpleDateFormat("dd-MM-yyyy");
        String presentDate=sdf.format(today);
        System.out.println("Current Date: "+presentDate);
        Calendar cal = new GregorianCalendar();
        cal.setTime(today);
        cal.add(Calendar.DAY_OF_MONTH, 25);
        Date newDate = cal.getTime();
        String date=sdf.format(newDate);
        System.out.println("Date after 25 days: "+date);

    }
}









Related Tutorials/Questions & Answers:
util packages in java
util packages in java  write a java program to display present date and after 25days what will be the date?   import java.util.*; import java.text.*; class FindDate{ public static void main(String[] args
Java packages
Java packages  What restrictions are placed on the location of a package statement within a source code file
Advertisements
Java Util Package - Utility Package of Java
Java Util Package - Utility Package of Java       Java Utility package is one of the most commonly used packages in the java program. The Utility Package of Java consist
Java Util Examples List
Java Util Examples List - Util Tutorials       The util package or java provides many utility interfaces and classes for easy manipulation of in-memory data. The java util
java.net packages - Java Beginners
java.net packages  Tell me some impotant classes to used in java.net packages?  hi friend, import java.net.*; import java.io...., http://www.roseindia.net/java/network/index.shtml Thanks
packages
packages  how to work with packages in java?   Have a look at the following links: http://www.roseindia.net/java/tools/master-java/java-package.shtml http://www.roseindia.net/java/master-java/java-package.shtml
packages
packages  how to work with packages in java?   Have a look at the following links: http://www.roseindia.net/java/tools/master-java/java-package.shtml http://www.roseindia.net/java/master-java/java-package.shtml
packages
packages  how to work with packages in java?   Have a look at the following links: http://www.roseindia.net/java/tools/master-java/java-package.shtml http://www.roseindia.net/java/master-java/java-package.shtml
packages
packages  how to work with packages in java?   Have a look at the following links: http://www.roseindia.net/java/tools/master-java/java-package.shtml http://www.roseindia.net/java/master-java/java-package.shtml
packages
packages  how to work with packages in java?   Have a look at the following links: http://www.roseindia.net/java/tools/master-java/java-package.shtml http://www.roseindia.net/java/master-java/java-package.shtml
packages
packages  how to work with packages in java?   Have a look at the following links: http://www.roseindia.net/java/tools/master-java/java-package.shtml http://www.roseindia.net/java/master-java/java-package.shtml
packages
packages  how to work with packages in java?   Have a look at the following links: http://www.roseindia.net/java/tools/master-java/java-package.shtml http://www.roseindia.net/java/master-java/java-package.shtml
packages
packages  how to work with packages in java?   Have a look at the following links: http://www.roseindia.net/java/tools/master-java/java-package.shtml http://www.roseindia.net/java/master-java/java-package.shtml
packages
packages  how to work with packages in java?   Have a look at the following links: http://www.roseindia.net/java/tools/master-java/java-package.shtml http://www.roseindia.net/java/master-java/java-package.shtml
packages
packages  how to work with packages in java?   Have a look at the following links: http://www.roseindia.net/java/tools/master-java/java-package.shtml http://www.roseindia.net/java/master-java/java-package.shtml
packages
packages  how to work with packages in java?   Have a look at the following links: http://www.roseindia.net/java/tools/master-java/java-package.shtml http://www.roseindia.net/java/master-java/java-package.shtml
creating packages in java
creating packages in java  Hi everybody, I am Rupesh Narayan, i faces a problem while creating package in core java. I write two programs that are described below:- 1.PackageDemo.java package javaclass; import java.io.*; public
Java Packages - Java Beginners
Java Packages  how to write a package by getting the inputs from the user?(ex: student details and staff qualification in one package)and also to compile and run this program
JAVA PACKAGES - Java Beginners
JAVA PACKAGES  I HAVE A DOUBT. I CRATED A PACKAGE BUT I AM NOT ABLE TO IMMPORT ANY FILES TO THE ANOTHER PACKAGE HOW CAN I IMPORT ANY PACKAGE FROM...://www.roseindia.net/java/master-java/index.shtml Thanks. Amardeep
packages - Java Beginners
Java package creation example  What is Package in Java? How can i create a package in Class
io packages - Java Beginners
io packages  How can I add two integers in java using io pacages
Java package,Java Packages
convention of packages A hierarchical naming pattern is used for java packages.... Packages in Core Java Package Description... Java Package      
java util date - Time Zone throwing illegal argument exception
java util date - Time Zone throwing illegal argument exception  Sample Code String timestamp1 = "Wed Mar 02 00:00:54 PST 2011"; Date d = new Date...()); The date object is not getting created for IST time zone. Java
packages
"); it compiles succesfully but when i do c:\world>java world.HelloWorld
Hi...doubt on Packages - Java Beginners
Package in java.. I have downloaded one program on Password Authentication... ..Explain me.  Hi friend, Package javax.mail The Java Mail API allows the developers to add mailing functionalities to their java applications
Lang and Util Base Libraries
Lang and Util Base Libraries The Base libraries provides us the fundamental features and functionality of the Java platform. Lang and Util Packages Lang and Util package provides the fundamental classes and Object of primitive type
Java Util Zip. Zip files/folders inside a folder, without zipping the original source folder.
Java Util Zip. Zip files/folders inside a folder, without zipping the original source folder.   import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.util.zip.ZipEntry; import