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 ?. ...
We use Excel file in our day to day work, for creating daily reports or maintaining expense sheet at home. Excel can also be used as a simple database, we can read entries from an excel file and can use them further in our program. We are using excel file to store Test execution reports, such as validation points, whether the test case is passed or not, true or false, and later using that cell information to decide whether the Test Case was passed or not. Excel automation plays an important role when using in Automation testing. We are using TestNG framework for our Test Case execution and stores the result in either Excel file(using java) or we use emailable reports from TestNG. We need to add external jar in our project to read and write excel file, POI jar is used to do this. You can download the jars from below link. Download POI Jars Follow below steps in eclipse to add the POI jars to your project After downloading the jars unzip the file Rig...
Comments
Post a Comment