Assignment | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Assignment

If we want assign a timing value in other variable (hour) so how can we assign this value?

27th Sep 2016, 6:07 PM
sabreen anjum
sabreen anjum - avatar
5 Answers
+ 1
If you are trying to assign a value to see the hour you can do this a few ways. One use a scanner and have the user input a value directly or get the current time in milliseconds store that value in hour and do the conversion because saying int hour = %tr hour is a variable and needs to be equal to another variable. %tr is not a method for storage but for strings. Date is also of its own type and can not simply be turned into hour.
28th Sep 2016, 3:51 AM
Joshua Parsons
Joshua Parsons - avatar
0
Can you rephrase the question? I'm not sure if you are asking how to assign a variable to a method or value to a variable? Some clarification will help
27th Sep 2016, 6:34 PM
Joshua Parsons
Joshua Parsons - avatar
0
http://www.sololearn.com/app/java/playground/cB45Cog3oQjV/ I got an error in this program please help to solve this.
28th Sep 2016, 3:11 AM
sabreen anjum
sabreen anjum - avatar
0
Thanks
28th Sep 2016, 4:02 AM
sabreen anjum
sabreen anjum - avatar
0
Could you please tell me how to show this program time according to location (country's time)?
28th Sep 2016, 7:26 AM
sabreen anjum
sabreen anjum - avatar