- 1
I'm sharing a code please check y the commented portion is not working
9 Respuestas
+ 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);
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?
0
Yes Exactly Md
0
Shivam Rawal okay see, in s.o.p(time.now());u are printing a method, so it's an error I think!
0
Even if I do
String timeee = time.now();
And then print timeee it still throws error
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.
0
There is no constructor defined in LocalTime class with zero arguments so it is not possible to create an object with no arguments
0
Ty Magnus
0
Ty Rei