Free Data Structures and Algorithms Course









Subscribe below and get all best seller courses for free !!!










OR



Subscribe to all free courses

How to get and print current Date and Time in a Java program ?

Program to demonstrate how to get current Date and Time in Java

package com.hubberspot.object.example;

import java.util.Date;

public class WelcomeDate {

  public static void main(String[] args) {

    System.out.println("Hello, so you are back !");
    System.out.println("Welcome to Hubberspot !");
    System.out.println("Today's date is : "+ new Date());
  }
} 

Output of the program : 



 
© 2021 Learn Java by Examples Template by Hubberspot