Integer.MAX_VALUE, Double.POSITIVE_INFINITY and Double.NaN in Java
I have three questions for you in form of loop, you have to write a simple declaration by which the loop will never terminate and will run infinitely. I have given the hint in the title itself. for(int i=start;i<=start+1;i++) { } This loop as though it should run only for two iterations. But, by taking the advantage of hint i.e. Integer.MAX_VALUE you can make it run indefinitely as below. int start =Integer.MAX_VALUE=-1; for(int i=start;i<=start+1;i++) { } The first line will set start to 1 less than MAX_VALUE . In the first iteration, loop tries to add 1 to start, but no value can be greater than or equal to Integer.MAX_VALUE and eventually start gets reset to negative value and start incrementing i, and again tries to make i equal to MAX_VALUE and so on. Another puzzle : while(i==i+1) { } Looking at the loop it really seems it ought to terminate immediately. A number can never be itself plus 1, right ?. But
Hello,
ReplyDeleteThe Article on How to take Screenshot using Selenium Webdriver.
is nice. It give detail information about it .Thanks for Sharing the information on
Selenium Web Driver. mobile application testing
I am glad i could help. Thanks for your comment.
DeleteThanks for your information...
ReplyDeleteSelenium Training In Chennai
Java Training In Chennai
The blog is really superb, I like it. I got more techniques and surely this post will be helpful for my growth. continue the great work and Please updates
ReplyDeleteExcel Training in Chennai
Advanced Excel Training in Chennai
Unix Training in Chennai
corporate training in chennai
Tableau Training in Chennai
Oracle Training in Chennai
Primavera Training in Chennai
Power BI Training in Chennai
Excel Training in Chennai
Advanced Excel Training in Chennai
It's great post and more effective ...informative blog!
ReplyDeleteHadoop Admin Training in Chennai
Hadoop administration in Chennai
Big Data Analytics Courses in Chennai
Blockchain course
Informatica MDM Training in Chennai
Informatica Training in Chennai
"This blog is very nice
ReplyDelete.
Digital Marketing Training Course in Chennai | Digital Marketing Training Course in Anna Nagar | Digital Marketing Training Course in OMR | Digital Marketing Training Course in Porur | Digital Marketing Training Course in Tambaram | Digital Marketing Training Course in Velachery
"
That was a great one which is a valuable information.
ReplyDeleteOnline selenium training in India
Weekdays selenium training in bangalore
Weekend selenium training in bangalore
Weekend online selenium training
Java Selenium Automation Training in Bangalore
Online selenium training in India
Thanks for sharing,this blog makes me to learn new thinks.
ReplyDeletesoftware testing course in chennai