While performing this program in BlueJ the syntax error is showing in the GregorianCalender while in sololearn its not | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

While performing this program in BlueJ the syntax error is showing in the GregorianCalender while in sololearn its not

import java.util.*; class Get_Current_Date_And_Time { public static void main(String args[]) { int day, month, year; int second, minute, hour; GregorianCalendar date = new GregorianCalendar(); day = date.get(Calendar.DAY_OF_MONTH); month = date.get(Calendar.MONTH); year = date.get(Calendar.YEAR); second = date.get(Calendar.SECOND); minute = date.get(Calendar.MINUTE); hour = date.get(Calendar.HOUR); System.out.println("Current date is "+day+"/"+(month+1)+"/"+year); System.out.println("Current time is "+h

21st Sep 2017, 4:08 AM
Adhiraj Dhar
Adhiraj Dhar - avatar
2 Answers
+ 9
You miss ); on end of code.
23rd Sep 2017, 12:52 AM
Vukan
Vukan - avatar
+ 2
no no that is because the description section in the question section has a limited no of words
23rd Sep 2017, 12:55 AM
Adhiraj Dhar
Adhiraj Dhar - avatar