We need to create a reference variable of class "Date" if we want to return date.
import java.util.*;
class Demo {
public static void main(String args[]) {
Date date=new Date();
System.out.println(date.toString());
}}
Can we return date and time without creating an object of Date class.