Tag: interview java programs

Frequently Asked Java Programs: 32 – Swap Two String Variables Without Using Third Variable

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 swap two String variables without using third variable. Problem Statement:- Before Swapping: String s1= “Java”; String s2= “Selenium”; After Swapping: String s1= “Selenium”; String s2= “Java”; We have already seen Swapping […]

Frequently Asked Java Program 30: Java Program to Find Distinct Characters In Given String

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 Distinct Characters In Given String. Problem Statement: User input: Make Selenium Easy Output: K L N I U Y Problem Solution:  Logic: Convert input string in to same case either upper […]

Frequently Asked Java Program 29: Java Program to Remove Duplicate Characters From Word Without Using Collection Concept

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 Remove Duplicate Characters From Word without Using Collection Concept. We have already seen above program using Collection concept. But interviewer might ask to solve it without using Collection APIs. Problem Statement: […]

Frequently Asked Java Program 22: Java Program to Trim Whitespace From String Without Using Trim Method

Hello Folks, This interview question was asked in Deloitte.  Write a java program to Trim a given string without using inbuilt trim() method of String Class in Java. “trim()” method of String class trims leading and trailing whitespace/s of given string. It does not remove whitespace between words. We need to write logic to do so. […]

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.