Category: Frequently Asked Java Programs In Interview

Frequently Asked Java Program 18: Java Program to Reverse Every Word of a String

Hello Programmers, “Java Program to Reverse Every Word of a String” is frequently asked programming interview questions to freshers and experienced. I will try here to explain logic in simple steps so that you do not need to remember lines of code. Just implement the logic and you can code it.  Problem statement: Original string      […]

Java Programs 17: Java Program to Find Duplicate Elements in Each Row of 2D Array

Hello Programers, Problem: How to find duplicate values in each row of 2D array. For example , we have 2d array as below: Output should be : 4 , Because 4 is common in each row. Solution: This was really brainstorming as I want to avoid multiple for loops to solve this problem. My logic […]

Java Programs 16: Java Program to Find Length of String Without Using Length Method

Hello Programmers, An interview candidate was asked to write java code to find the length of given string WITHOUT USING LENGTH METHOD in Capgemini. In this post, I will find length of string without using Length method but using some other method. :-p There is another method in String class called lastIndexOf(). LastIndexOf() method: As […]

Java Programs 15: Java Program to Print Fibonacci Series at Given Position Using Recursion

Hello Folks, It is frequently asked interview question to write a java program to print fibonacci number at any given position. I have already explained about program logics to print fibonacci series using both recursive and iterative model. Java program to print fibonacci series using iteration logic java program to print fibonacci series using recursion […]

Java Programs 14: Java Program to Print Fibonacci Series of Given Length Using Recursion

Hello Folks, This is a frequently asked programming interview question to print a fibonacci series of given length. In previous post, we have seen printing fibonacci series using iterative logic with collection concept. This will be acceptable for freshers but not for experienced, interviewer expects recursion logic.  This post explains in details how recursion takes […]

Java Programs 13: Java Program to Print Fibonacci Series of Given Length Using Collection

Hello Folks, This is a frequently asked programming interview question to print a fibonacci series of given length. Fibonacci series: Wikipedia defines it very well. The Fibonacci numbers are the numbers in the following integer sequence, called the Fibonacci sequence, and characterized by the fact that every number after the first two is the sum of the two preceding […]

Frequently Asked Java Program 12: Java Program To Find Divisors Of Given Number

Hello Folks, As part of Frequently Asked Java Programs In Interviews For Freshers And Experienced, in this post we will see a Java program to Find Divisors Of Given Number. Problem: Write a JAVA program to find the divisors of a given number. Solution: Divisor is a number that divides  another number without a reminder or a number […]

Frequently Asked Java Program 11: Find Position Of Letter In Alphabet

Hello Folks, As part of Frequently Asked Java Programs In Interviews For Freshers And Experienced, in this post we will see a Java program to Find Position Of Letter In Alphabet. Problem: Accept a letter from user and print position of input letter in alphabet. Example: A has 1st position in alphabet. B has 2nd position in […]

Frequently Asked Java Program 10: Draw An Equilateral Triangle Using Stars Of Given Row

Hello Folks, As part of Frequently Asked Java Programs In Interviews For Freshers And Experienced, in this post we will see a Java program to Draw An Equilateral Triangle Using Stars Of Given Row. Problem statement: Draw an Equilateral Triangle using stars of given row. Example: An Equilateral Triangle of 5 rows: Solution: Number of stars in a row is equal […]

Frequently Asked Java Program 09: Printing Words In Circular Order From Given Index

Hello Folks, As part of Frequently Asked Java Programs In Interviews For Freshers And Experienced, in this post we will see a Java program to Printing Words In Circular Order From Given Index. Problem: Suppose you have below string: “Make Selenium Easy” Where -“Make” is at position zero. -“Selenium” is at first position . -“Easy” is at […]

Please wait...

Subscribe to new posts to become automation expert

Want to be notified when my new post is published? Get my posts in your inbox.