Home > Java (Page 3)

Simple way to generate connection string from text file

Common issue generally every developer faces in his initial days of development is how to generate connection string that connects my application to the database. Especially when we don't have sql management studio installed or if we are facing licensing issues.Well, a text file can come to a rescue.  To overcome such

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-66066a5833629269553445/][crayon-66066a5833634436750820/]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-66066a5833f1b359212215/] [crayon-66066a5833f25293645900/]Advantages of method overridingThe main advantage of

This Article is TAGGED in , , . Read more