Java programs

Let’s learn convert string to date in java. Convert string to date in java In this post let us learn how to convert string to date java. Here is the table where we have some date and time patterns used in java.text.SimpleDateFormat. Letter Description Examples y Year 2014 M Month in year June, 06, 6 d…

Read More Convert string to date in java

Let’s learn symmetric matrix program in java. Symmetric matrix program in java A square matrix is said to be symmetric if given square matrix is equal to its transpose. How to tell if a matrix is symmetric? For a matrix to be symmetric, first it should be a square matrix and second every element at…

Read More Symmetric matrix program in java

Let’s learn What is a Fibonacci series in java? Fibonacci series in java A fibonacci series is a sequence where next number is sum of previous two numbers. fibonacci sequence java: 0, 1, 1, 2, 3, 5, 8, 13, 21 . . . . . Let’s see program for fibonacci series in java. public class…

Read More Fibonacci series in java

Let’s learn matrix addition and subtraction in java. Matrix addition and subtraction in java A matrix represents a two-dimensional array. In matrix addition first user enters the number of rows and columns using nextInt() method of Scanner class. This user entered number is stored in two integer variables row and col. Then nested for loop…

Read More Matrix addition and subtraction in java

Let’s learn java program to swap two numbers. Java program to swap two numbers How do you write program to swap two numbers is one of the frequently asked interview question. Let’s learn two ways to swap two numbers in java. using temporary variable without using temporary variable Using temporary variable To swap two numbers…

Read More Java program to swap two numbers

Let’s learn java program to find simple interest. Java program to find simple interest Write a java program to calculate simple interest is the one of the frequently asked question in interview. Simple interest is used to enumerate interest on loan in banks. It is calculated by using formula, Simple Interest = (P x R…

Read More Java program to find simple interest

Let’s learn java program to print alphabets. Java program to print alphabets Write a java program to print all alphabets from a to z in lowercase using while loop is the most asked interview question. To begin with let’s see program to print alphabets in lowercase. Here in this case internally we loop through 97…

Read More Java program to print alphabets