Java Program to calculate Perimeter/Circumference of Circle

One of the common programming exercise for beginners is to write a program to calculate the perimeter or circumference of a circle in Java. This exercise is not just common in Java but also on other programming language courses e.g. C, C++ or Python. I first did this exercise on C++ long ago, but that time the joy of a working program was something different. I was quite happy to see my program compiled without error and can print the correct circumference after entering radius. That program taught me how to take input from a user and how to display output into the console, I didn't know how to create methods to encapsulate code. For us, only main method matters at that time. Anyway, let's focus on the job at hand i.e. how to find the circumference of Circle of given radius. You have to accept radius from the user and show the output to console.

How to add JAR file in Eclipse Project Build path - External dependency

In this Java Eclipse tutorial, I will show you two ways to add external JAR files in Eclipse Java projects. Many times we need to use external JAR files in our Java application for different needs e.g. for general purpose you may use Google Guava or Apache Commons. If you are using Spring or Hibernate framework then you need their JAR files as well. In order to use any third-party library or framework, we have to add their JAR files in the classpath, to compile and run our Java programs. Since Eclipse is the most popular IDE for developing Java applications, it's important to know how you can add external JARs into your Java project's build path. For example, suppose, you have downloaded Apache commons JAR file from the internet and wants to add that file to your Java project. In order to use classes and methods from that library, your project must reference those and this is what we will learn here.