Home > Java

Java library for text file operations

To perform text file operation like Create File, Compare Text file, Replace words etc we have created jar which you can download Attached Zip File: TextUtility  After extracting zip file you will get jar file which contains below functionality which is extremely easy to use. Functions appendLine → Read Text File and append new

This Article is TAGGED in , , , , . Read more

MS SQL connection using JDBC in Selenium

To connect MS SQL database using jdbc driver in java, we need to download jdbc driver for MS SQL server. Refer below link to download MS SQL jdbc driver file.  Add external Jar file to project: Right click on project, Go to properties → Java Build Path → Click on Library tab  Add external

This Article is TAGGED in , . Read more

Compare images using Java

This code will compare pixel from base image with other image. If both pixel at location (x,y) are same then add same pixel in result image without change. Otherwise it modifies that pixel and add to our result image. In case of baseline image height or width is larger than other image

This Article is TAGGED in , , . Read more

Method overloading in Java – Part 1

What is method overloading in Java?If two or more methods in a class have same name but different parameters, it is known as method overloading. Method overloading is one of the ways through which java supports polymorphism. Method overloading can be done by changing number of arguments or by changing

This Article is TAGGED in , , , , , . Read more

Method overloading in Java – Part 2

Method overloading with type promotion:One type is promoted to another implicitly if no matching datatype is found. Let's understand the concept by the figure given below: Example: Method Overloading with Type Promotion[crayon-62bbf52699ba5801305802/][crayon-62bbf52699bac745612265/]If there are matching type arguments in the method, type promotion is not performed:Example: Method Overloading with Type Promotion if

This Article is TAGGED in , . Read more

Method Overriding in Java: – PART-2

 Real example of Java Method Overriding:-Consider a scenario, Bank is a class that provides functionality to get rate of interest. But, rate of interest varies according to banks. For example, SBI, ICICI and AXIS banks could provide 5%, 6% and 7% rate of interest. [crayon-62bbf5269a30a464221474/] [crayon-62bbf5269a30f424502080/]Advantages of method overridingThe main advantage of

This Article is TAGGED in , , . Read more