I'm sharing a code please check y the commented portion is not working | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

I'm sharing a code please check y the commented portion is not working

https://code.sololearn.com/cJ7X590XB9dF/?ref=app

30th Aug 2020, 9:16 AM
Shivam Rawal
9 Answers
+ 1
I'm asking after importing Java.time.LocalTime; can I create obj like this and then use now method? LocalTime time = new LocalTime(); String timeee = time.now(); System.out.println(timeee);
30th Aug 2020, 9:27 AM
Shivam Rawal
0
Shivam Rawal what Do u mean by comment is not working, like we make comment for btr understanding and inactive(not working ).. BTW, ur code is Fyn, what do want to ask?
30th Aug 2020, 9:24 AM
RuntimeERROR
RuntimeERROR - avatar
0
Yes Exactly Md
30th Aug 2020, 9:28 AM
Shivam Rawal
0
Shivam Rawal okay see, in s.o.p(time.now());u are printing a method, so it's an error I think!
30th Aug 2020, 9:30 AM
RuntimeERROR
RuntimeERROR - avatar
0
Even if I do String timeee = time.now(); And then print timeee it still throws error
30th Aug 2020, 9:32 AM
Shivam Rawal
0
now() is a static method, you should only call it from its class not an Object/instance the error from commented code comes from lack of arguments/parameters, looks like localtime need 4 int to work.
30th Aug 2020, 9:33 AM
Rei
Rei - avatar
0
There is no constructor defined in LocalTime class with zero arguments so it is not possible to create an object with no arguments
30th Aug 2020, 10:05 AM
Magnus
0
Ty Magnus
30th Aug 2020, 12:55 PM
Shivam Rawal
0
Ty Rei
30th Aug 2020, 12:56 PM
Shivam Rawal