Programming Languages Tutorials

Java Program Number Triangle Pattern Five

  • Java program to print number triangle pattern five using for loop.
Sample Output,
1 2 3 4 5 
1 2 3 4 
1 2 3 
1 2 
1 
1 2 
1 2 3 
1 2 3 4 
1 2 3 4 5

Java Program to Print Palindrome Pyramid Pattern

  • Java program to print palindrome pyramid pattern using for loop.
Sample Output,
     1
    121
   12321
  1234321
 123454321
12345654321

Java Program to Reverse Array Elements

  • Java program to reverse array elements and print it on screen using for loop.

In this java program, given an integer array of length N we have to print array elements in reverse sequence. In reversed array, first element of original array become the last element, second element becomes second last element and so on.

Java Program to Delete an Element from Array at Given Position

  • Java program to delete an element from array at any given index.

In this java program, given an array of length N, we have to delete an element from array at index i (0 <= i <= N-1). After deletion, the number of elements in array will reduce by one. To delete an element at index i we have to shift all elements from index i+1 to N-1 to previous index.

Java Program to Convert Octal to Decimal Number

  • Write a Java program to convert octal number to decimal number system.

In this java program, we will take an octal number from user and then convert it to decimal number system.
For Example,
144 in Octal is equivalent to 100 in Decimal number system.

Java Program to Check Whether two Strings are Equal or Not

  • Java program to compare two strings using equals method.
  • Java program to check whether two strings are equal or not.

Java Program to Convert Decimal to Binary Numbers

  • Write a Java program to convert decimal number to binary number.
  • Java program to convert base 10 number to base 2 number.

In this java program, we will take a decimal number as input from user and then convert it to binary number. Before jumping into java program, here is the brief introduction of binary and decimal number systems.

Java Program to Insert an Element in Array at Given Position

  • Write a java program to insert an element in array at any given index using for loop.

In this java program, given an array of N elements, we have to insert an element at index i (0 <= i <= N-1) without using extra memory space.

Java Program to Delete all Vowel Characters from String

  • Java program to remove all vowel alphabets from a string using replaceAll() method.
  • Java program to delete all vowels from a string without using any library function.

In this java program, we have to delete all occurrences of vowel characters from a given string and then print it on screen.