util packages in java

util packages in java

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

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);

    }
}

Ads









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
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
Advertisements
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
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
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 package,Java Packages
convention of packages A hierarchical naming pattern is used for java packages.... Packages in Core Java Package Description... Java Package      
packages
"); it compiles succesfully but when i do c:\world>java world.HelloWorld
Maven dependency for com.gu - story-packages-model_2.11 version 0.4.0 is released. Learn to use story-packages-model_2.11 version 0.4.0 in Maven based Java projects
; com.gu - story-packages-model_2.11 version 0.4.0 in Java projects. Follow...-packages-model_2.11 version 0.4.0 java library in your project. Now you can...Maven dependency for  com.gu  - Version 0.4.0 of story-packages
Maven dependency for com.gu - story-packages-model_2.11 version 2.0.3 is released. Learn to use story-packages-model_2.11 version 2.0.3 in Maven based Java projects
; com.gu - story-packages-model_2.11 version 2.0.3 in Java projects. Follow...-packages-model_2.11 version 2.0.3 java library in your project. Now you can...Maven dependency for  com.gu  - Version 2.0.3 of story-packages
Maven dependency for com.gu - story-packages-model_2.11 version 2.0.4 is released. Learn to use story-packages-model_2.11 version 2.0.4 in Maven based Java projects
; com.gu - story-packages-model_2.11 version 2.0.4 in Java projects. Follow...-packages-model_2.11 version 2.0.4 java library in your project. Now you can...Maven dependency for  com.gu  - Version 2.0.4 of story-packages
packages
Regarding Documentation of Packages
Regarding Documentation of Packages  Hello How to get java packages ie documentation of classes ,Interfaces and methods from windows command prompt.In the sense Java.lang,java.awt,java.math etc
Maven dependency for com.gu - story-packages-model-thrift version 2.0.3 is released. Learn to use story-packages-model-thrift version 2.0.3 in Maven based Java projects
to use  com.gu - story-packages-model-thrift version 2.0.3 in Java projects...; com.gu - story-packages-model-thrift version 2.0.3 java library in your...Maven dependency for  com.gu  - Version 2.0.3 of story-packages
Maven dependency for com.gu - story-packages-model-thrift version 2.0.4 is released. Learn to use story-packages-model-thrift version 2.0.4 in Maven based Java projects
to use  com.gu - story-packages-model-thrift version 2.0.4 in Java projects...; com.gu - story-packages-model-thrift version 2.0.4 java library in your...Maven dependency for  com.gu  - Version 2.0.4 of story-packages
ModuleNotFoundError: No module named 'packages'
ModuleNotFoundError: No module named 'packages'  Hi, My Python... 'packages' How to remove the ModuleNotFoundError: No module named 'packages... to install padas library. You can install packages python with following
Packages needed for JDBC in Linux
Packages needed for JDBC in Linux  Can anyone tell me the packages needed to run a program with JDBC in Red Hat 5
Version of com.cedarsoftware>java-util dependency
List of Version of com.cedarsoftware>java-util dependency
Version of com.livae>java-util dependency
List of Version of com.livae>java-util dependency
Version of com.metamx>java-util dependency
List of Version of com.metamx>java-util dependency
Version of com.simiacryptus>java-util dependency
List of Version of com.simiacryptus>java-util dependency
Joomla Development Packages
Joomla Development Packages  In offshore services, we also offer a full-bodied package on various Joomla CMS like: Joomla Custom Templates Package Joomla Starter Package Joomla Standard Package Joomla Composite Package
Other Base Packages
Other Base Packages I/O For handling i/o of an application in java , java.io... for the development of the beans. Java Management Extensions (JMX) For monitoring and managing resources we incorporate this API which is termed as Java Management

Ads