Frequently Asked Java Program 21: Java Program to Find & Print All Special Characters with Their Positions in a String

This programming interview question was asked in Yodlee.  Problem: Write a Java program to find and print all special characters with their positions in a user input string. Example: Input string: Make%Selenium$Easy# Output: % at position 5. $ at position 14. # at position 19. Total special characters found:3 Solution: We will use regex to

Read More

Frequently Asked Java Program 19: Java Program to Reverse Position of Words in a String

Problem statement: Write a Java program to reverse position of words in given string i.e. word at first position in string should be at last position in string. Input String: You are awesome Output String: awesome are You Solution: It is a very easy program. You just need understanding of splitting a string, array and

Read More

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     

Read More

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

Read More

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

Read More

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

Read More

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

Read More

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.