Java Programming Examples

If you are a looking forward to a rewarding career in coding and software development, you may have to face Java Interview Questions. For that you must have a thorough understanding of a variety of Java Programming examples.  In this tutorial segment we will explain some of the best Java Programming examples to help you in preparing well for such interviews.

The Java Programming Examples in this tutorial are interactive so that the user can input the data and display its output for entered values. For this we have used Java Reading Console Input. It makes the programs flexible to match the users need.

For your focused learning we have categorized the Java Programming examples under the following categories.

  • Java Basic Programs
  • Java Recursion Programs
  • Java Linear Array Programs
  • Java 2-D Array Programs
  • Java Classes and Objects Programs
  • Java Inheritance Programs
  • Java Interfaces Programs
  • Java Packages Programs
  • Java Data Structures Programs
  • Java Searching and Sorting Programs
  • Java Multithreading Programs
  • Java Applet Programs
  • Java AWT programs

Java Basic Programs

  1. Java Greatest of Three Numbers Program
  2. Java Leap Year Program
  3. Java Area of a Circle Program
  4. Java Area of a Rectangle Program
  5. Java Simple Interest Calculation Program
  6. Java Print Multiplication Table Program
  7. Java Calculate Total marks and Percentage of a Student Program
  8. Java calculate Net salary of an employee with given Basic Pay and allowances deductions in percentages Program
  9. Java Calculate Roots of Quadratic Equation Program
  10. To determine whether character entered is vowel, consonant, digit or special characters.

All the Java Programming examples discussed here use variables names written in Camel Notation.

The variables names represent the task being done through them. The first part of the variable name begins with three characters representing data type of the variable. This part is written in lowercase. Rest of the variable name consists of the words that represents the task or meaning of the variable. Each such word begins with an uppercase letter.

For example

  • strStudentName – name of student as string data type
  • intRollNumber- roll number as integer data type
  • fltSalary- Salary as float data type.