Category: Interview Java Programs

• How to Reverse an Array in Java

In this post, we will show you simple program about, How to reverse an array in Java. The example program has been tested and shared in the same post. Example… Continue reading "How to Reverse an Array in Java"

• Find Highest and Lowest Number in the Array using Java

Here I have attached Simple Interview question for Find Highest and Lowest Number in the Array using Java Programming Language. FindHighLowNumber.java package com.javatraineronline.example; public class FindHighLowNumber { public void getHighLowNumber(int[]… Continue reading "Find Highest and Lowest Number in the Array using Java"

• Converting Decimal to Binary using Java Program

ConvertDecimalToBinary.java package com.javatraineronline.example; public class ConvertDecimalToBinary { public void covertBinaryFormat(int number){ int binaryArray [] = new int[25]; int position = 0; while(number > 0){ binaryArray[position++] = number%2; number = number/2;… Continue reading "Converting Decimal to Binary using Java Program"

• FLAMES Program in Java Language

package com.javatraineronline; import java.io.BufferedReader; import java.io.InputStreamReader; public class Flames { public static void main(String[] args) throws Exception { System.out.println("Welcome to FLAMES Applications"); BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); System.out.println("Enter Your… Continue reading "FLAMES Program in Java Language"

• Inverse Triangle Example in Java Program

Inverse Triangle Example in Java In this example, I am attaching simple program about, Inverse Triangle Example in Java. The program were tested and shared in the post. InverseTriangle.java package… Continue reading "Inverse Triangle Example in Java Program"

• Swapping Two Numbers in Java Program

package com.javatraineronline; public class SwapNumber { public static void swap(int a, int b) { // Assigning 'a' value to 'temp' int temp = a; // Assigning 'b' value to 'a'… Continue reading "Swapping Two Numbers in Java Program"

• Recursive Fibonacci in Java

Recursion.java public class Recursion { public static void main(String[] args) { int n1 = 0; int n2 = 1; System.out.println(n1); System.out.println(n2); doRecursion(n1, n2); //Doing Recursion Here } public static int… Continue reading "Recursive Fibonacci in Java"

• Cross String Program in Java

The Simple Cross String Program in Java CrossString.java package com.javatraineronline; public class CrossString { public static void main(String[] args) { String data = "welcome";// Get the String to be crossed… Continue reading "Cross String Program in Java"

• Simple Hour Glass Program in Java

The following program to create Simple Hour Glass in Java. HourGlass.java package com.javatraineronline; public class HourGlass { public static void main(String[] args) { // Initialize the 2D array. Here we've… Continue reading "Simple Hour Glass Program in Java"