tag:blogger.com,1999:blog-7258332205026269340.post4481101712669131165..comments2024-02-21T01:43:44.367-08:00Comments on Selenium-By-Arun: 40. 'long' data typePriyanka Motoorihttp://www.blogger.com/profile/04643338373711611455noreply@blogger.comBlogger12125tag:blogger.com,1999:blog-7258332205026269340.post-69105373897969658472017-03-23T07:02:45.509-07:002017-03-23T07:02:45.509-07:00@pratishak yes, java is case sensitive. @pratishak yes, java is case sensitive. Arun Motoorihttps://www.blogger.com/profile/18156045285817519369noreply@blogger.comtag:blogger.com,1999:blog-7258332205026269340.post-70252347152150997922017-03-23T06:35:11.816-07:002017-03-23T06:35:11.816-07:00Hi Arun - Your blog is very helpful for new learne...Hi Arun - Your blog is very helpful for new learner. <br />Just had a small query, is JAVA case sensitive? Do we need to use 'String arg[]' with upper case S only or can we use it as with lower case s as well (i.e 'string args[]') ?PratikshaKhttps://www.blogger.com/profile/15079123397807487939noreply@blogger.comtag:blogger.com,1999:blog-7258332205026269340.post-13274474503642768952016-11-10T16:31:38.918-08:002016-11-10T16:31:38.918-08:00Yes, as Asha said we have to declare seconds varia...Yes, as Asha said we have to declare seconds variable as long type. <br /><br />This logic you can understand after understanding the Java literals concepts. <br /><br />The below will happen if we don't declare the seconds variable with long data type:<br /><br />seconds variable will hold the integer value 86400 and lightspeed variable will also hold the integer value 186000. Integer value Arun Motoorihttps://www.blogger.com/profile/18156045285817519369noreply@blogger.comtag:blogger.com,1999:blog-7258332205026269340.post-61331714944729665602016-08-20T06:51:50.287-07:002016-08-20T06:51:50.287-07:00@Ravi- we should use long for seconds variable als...@Ravi- we should use long for seconds variable also. Then we get correct output.Ashahttps://www.blogger.com/profile/02668376986673697456noreply@blogger.comtag:blogger.com,1999:blog-7258332205026269340.post-37503977834284019632016-08-06T00:21:15.325-07:002016-08-06T00:21:15.325-07:00@Ashwini: Ravi's query is diiferet:
He want t...@Ashwini: Ravi's query is diiferet:<br /><br />He want to use 'long' data type only for variable 'distance' and for others 'int' is sufficient.<br /><br />I have tried this logic and getting wrong output.Anonymoushttps://www.blogger.com/profile/13618338660633068336noreply@blogger.comtag:blogger.com,1999:blog-7258332205026269340.post-58562954525457137312016-06-10T05:15:10.249-07:002016-06-10T05:15:10.249-07:00@ Ravi,
Try below code.. its working
public class...@ Ravi,<br />Try below code.. its working<br /><br />public class Light {<br /><br /> public static void main(String[] args) {<br /> long lightspeed,days,seconds,distance;<br /> lightspeed=186000;<br /> days=1000;<br /> seconds= 24*60*60;<br /> distance=lightspeed*seconds;<br /> System.out.print("In "+ days);<br /> System.out.print(" days light will travel about");<br /Anonymoushttps://www.blogger.com/profile/13690237131984920313noreply@blogger.comtag:blogger.com,1999:blog-7258332205026269340.post-1011215546074585632016-04-09T04:55:35.762-07:002016-04-09T04:55:35.762-07:00Hi Arun,
I have tried this program using long data...Hi Arun,<br />I have tried this program using long data type only for distance and used int for all other variables but still the output is wrong. Can you please tell me why?Anonymoushttps://www.blogger.com/profile/14359989770062978909noreply@blogger.comtag:blogger.com,1999:blog-7258332205026269340.post-53416691221949148052015-05-27T09:22:36.025-07:002015-05-27T09:22:36.025-07:00Thanks Arun!! , needless to say .. your blog is on...Thanks Arun!! , needless to say .. your blog is one of the best till date and it has given me a hope that i'll learn Java and selenium :)Anonymoushttps://www.blogger.com/profile/00523600604003395791noreply@blogger.comtag:blogger.com,1999:blog-7258332205026269340.post-54160885494543868522015-05-22T11:26:00.566-07:002015-05-22T11:26:00.566-07:00@Preeti - First of all long type variable can be a...@Preeti - First of all long type variable can be assigned with either integer value (i.e. without L ) or long values (with L). Hence long var1 = 1234; is a valid statement and also long var1 = 1234L; is also a valid statement. 1234 is treated as integer literal which can be assigned to long type variable and also 1234L is treated as a long type literal which can be assigned to long type variable.Arun Motoorihttps://www.blogger.com/profile/18156045285817519369noreply@blogger.comtag:blogger.com,1999:blog-7258332205026269340.post-69302727428138135882015-05-22T10:51:53.683-07:002015-05-22T10:51:53.683-07:00In post#39 , in comment section Arun mentioned to ...In post#39 , in comment section Arun mentioned to we need to add the letter L at the end of the literal.when ever variable data type is long (i.e. long count = 9223372036854775807L).<br /><br />But when I am seeing the example given my him in this post #40 he has not used Literal L as the end of value. I feel literal "L" should be used at the end of value assigned to Lightspeed and daysAnonymoushttps://www.blogger.com/profile/00523600604003395791noreply@blogger.comtag:blogger.com,1999:blog-7258332205026269340.post-77649269092660407412014-07-01T22:24:12.830-07:002014-07-01T22:24:12.830-07:00@Raghavan V - Updated. Thank You very much :)@Raghavan V - Updated. Thank You very much :)Arun Motoorihttps://www.blogger.com/profile/18156045285817519369noreply@blogger.comtag:blogger.com,1999:blog-7258332205026269340.post-3827573300107310552014-07-01T08:48:39.715-07:002014-07-01T08:48:39.715-07:00in line7 (lightspeed = 186000;)
";" is m...in line7 (lightspeed = 186000;)<br />";" is missedAnonymoushttps://www.blogger.com/profile/11891589662183004431noreply@blogger.com