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...
The loop : Inside Out Have a look at below code and guess what could be the output. public class Puzzle26 { public static final int END=Integer.MAX_VALUE; public static final int START=END-100; public static void main(String args[]) { int count = 0; for(int i=START;i<=END;i++) count++; System.out.println(count); } } At a first glance you might think this will print 100, off course because, END is 100 more than START. But look more carefully we are using less than equal to sign. So now you might guess it will print 101. Well, no. This program does not print a thing. The reason is every integer is less than or equal to Integer.MAX_VALUE. And the moment our program increases Integer.MAX_VALUE there cannot be any value greater than that so it increments the variable i to -2147483648 , which is the lowest integer value and then keeps incrementing it to 2147483647 i.e. the largest integer value and ...
Comments
Post a Comment