Home > Back-end >  Just open the Java classes
Just open the Java classes

Time:09-20

Please answer

CodePudding user response:

 public static void main (String [] args) {
Scanner scanner=new Scanner(System.in);
System. The out. Println (" please enter the number of milliseconds: ");
Long l=scanner. NextLong ();
The Date the Date=new Date ();
Date. SetTime (l);
The String pattern="hh: mm: ss".
SimpleDateFormat df=new SimpleDateFormat (pattern);
String format=df. The format (date);
System. The out. Println (format);
Scanner. The close ();
}

CodePudding user response:

reference 1/f, don't drink coffee love tea response:
 public static void main (String [] args) {
Scanner scanner=new Scanner(System.in);
System. The out. Println (" please enter the number of milliseconds: ");
Long l=scanner. NextLong ();
The Date the Date=new Date ();
Date. SetTime (l);
The String pattern="hh: mm: ss".
SimpleDateFormat df=new SimpleDateFormat (pattern);
String format=df. The format (date);
System. The out. Println (format);
Scanner. The close ();
}

Seems to have no lines 5 and 8 fault

CodePudding user response:

refer to the second floor weixin_48469184 response:
Quote: reference 1/f, don't drink coffee love tea response:
 public static void main (String [] args) {
Scanner scanner=new Scanner(System.in);
System. The out. Println (" please enter the number of milliseconds: ");
Long l=scanner. NextLong ();
The Date the Date=new Date ();
Date. SetTime (l);
The String pattern="hh: mm: ss".
SimpleDateFormat df=new SimpleDateFormat (pattern);
String format=df. The format (date);
System. The out. Println (format);
Scanner. The close ();
}

Seems to have no lines 5 and 8 wrong

Is the inside of the toolkit to guide package Date util

CodePudding user response:

refer to the second floor weixin_48469184 response:
Quote: reference 1/f, don't drink coffee love tea response:
 public static void main (String [] args) {
Scanner scanner=new Scanner(System.in);
System. The out. Println (" please enter the number of milliseconds: ");
Long l=scanner. NextLong ();
The Date the Date=new Date ();
Date. SetTime (l);
The String pattern="hh: mm: ss".
SimpleDateFormat df=new SimpleDateFormat (pattern);
String format=df. The format (date);
System. The out. Println (format);
Scanner. The close ();
}

Seems to have no lines 5 and 8 wrong

In the beginning of an import Java. Util. Date

CodePudding user response:

reference 4 floor CKApril_java response:
Quote: refer to the second floor weixin_48469184 response:
Quote: reference 1/f, don't drink coffee love tea response:
 public static void main (String [] args) {
Scanner scanner=new Scanner(System.in);
System. The out. Println (" please enter the number of milliseconds: ");
Long l=scanner. NextLong ();
The Date the Date=new Date ();
Date. SetTime (l);
The String pattern="hh: mm: ss".
SimpleDateFormat df=new SimpleDateFormat (pattern);
String format=df. The format (date);
System. The out. Println (format);
Scanner. The close ();
}

Seems to have no lines 5 and 8 wrong

In the beginning of an import Java. Util. Date

Running hours is wrong
  • Related